javaextensions/sensor/src.s60/csensorbase.cpp
changeset 50 023eef975703
parent 21 2a9601315dfc
child 64 0ea12c182930
--- a/javaextensions/sensor/src.s60/csensorbase.cpp	Tue Jul 06 20:36:19 2010 +0300
+++ b/javaextensions/sensor/src.s60/csensorbase.cpp	Fri Jul 09 16:35:45 2010 +0300
@@ -139,7 +139,14 @@
 void CSensorBase::AsyncCallback(TMethod aMethod)
 {
     JELOG2(ESensor);
-    iMethodArray.Append(aMethod);
+    TInt err = iMethodArray.Append(aMethod);
+    // if there was error when adding the method to array then just return
+    if ( err  )
+    {
+        ELOG2(ESensor, "CSensorBase::AsyncCallback - Error (code = %d) when "
+              "adding method (type = %d) to method buffer.", err, aMethod.iMethodType);
+        return;
+    }
 
     // If there is old request ongoing, wait it for completion
     if (iMethodArray.Count() > 1)