javauis/mmapi_akn/baseline/src/cmmasnapshotevent.cpp
branchRCL_3
changeset 83 26b2b12093af
parent 66 2455ef1f5bbc
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
    46 void CMMASnapshotEvent::Dispatch(JNIEnv& aJni)
    46 void CMMASnapshotEvent::Dispatch(JNIEnv& aJni)
    47 {
    47 {
    48     DEBUG("MMA::CMMASnapshotEvent::Dispatch");
    48     DEBUG("MMA::CMMASnapshotEvent::Dispatch");
    49 
    49 
    50     // create java byte array
    50     // create java byte array
    51 
       
    52     jbyteArray byteArray;
    51     jbyteArray byteArray;
    53 
    52 
    54     if (iImageBuffer)
    53     if (iImageBuffer)
    55 
       
    56     {
    54     {
    57         byteArray = aJni.NewByteArray(iImageBuffer->Size());
    55         byteArray = aJni.NewByteArray(iImageBuffer->Size());
    58         if (byteArray)
    56         if (byteArray)
    59         {
    57         {
    60             ArrayUtils::CopyToJava(aJni,
    58             ArrayUtils::CopyToJava(aJni,
    82                         iHandleEventMethod,
    80                         iHandleEventMethod,
    83                         iEventData,
    81                         iEventData,
    84                         byteArray);
    82                         byteArray);
    85 
    83 
    86     delete iImageBuffer;
    84     delete iImageBuffer;
       
    85 
    87     iImageBuffer = NULL; // otherwise double delete in destructor
    86     iImageBuffer = NULL; // otherwise double delete in destructor
    88 
       
    89     aJni.DeleteLocalRef(byteArray);
    87     aJni.DeleteLocalRef(byteArray);
    90 
    88 
    91 }
    89 }
    92 
    90 
    93 //  END OF FILE
    91 //  END OF FILE