Griaule Biometrics

Home » Forums » FINGERPRINT SDK » C/C++ Specific » Releasing rawImage in CMyControl::ImageAcquired function
2 replies [Last post]
asfiqbal
Offline
Joined: 2011-02-07
Rate this post:
0
No votes yet
Releasing rawImage in CMyControl::ImageAcquired function

Dear All,

In all the Fingerreader VC samples we are seeing following code fragment.

void STDMETHODCALLTYPE CMyControl::ImageAcquired (BSTR idSensor,long width,long height,VARIANT * rawImage,long res )

...

::VariantInit(&m_RawImage);

V_VT(&m_RawImage) = VT_VARIANT ; VariantCopy(&m_RawImage,rawImage); m_RawImageHeigth = height; m_RawImageWidth = width; m_RawImageResolution = res;

My question is that do we need to release the memory allocated for rawImage? the above fragment copying the safearray and i dont find any place where it is releasing the memory.
Really Appreciate an urgent response.
Regards,
Asif
asfiqbal
Offline
Joined: 2011-02-07
Rate this post:
0
No votes yet

Dear Support Team,

We are facing   Griuale Library crashes issue in the development.

We think that we some how managed to identify the root cause of the problem. Below are the sequence

* We have eliminated the Finalize crash issue. This was causing because m_GrFingerCtrl reference count has not been released and beacuse of this IE thinks that control is still active and do not call its release. For the solution we created a method named Destroy that manually releases all the control member variables. We called this method on Body unload. After this IE release the control and FinalRelease has been called theirby no more crashes in Finalize (Final Construct) when control is rebuilt after page refresh.

* We also have identified a memory leak in the VS sample code. When user press his finger over microsoft biometric reader Griaule Library create a safe array (allocating memory) and pass it in  ImageAcquired (BSTR idSensor,long width,long height,VARIANT * rawImage,long res ) event. This rawImage don't get release in the code. We have forcefully released this using ::VariantClear(rawImage)

* We see no control crashes if we follow following sequence.
Initialize -> StartEnroll -> ImageAcquired -> Enroll -> Destroy -> Page Refresh -> Start over. We think that this is because ImageAcquired fired only once and library do not get overburden.

* Following Sequence crashed the control in two or three round trips.
Initialize -> StartEnroll -> ImageAcquired -> Enroll ->  
ImageAcquired -> Enroll -> ImageAcquired -> Enroll -> Destroy -> Page Refresh -> Initialize -> StartEnroll (IE crashes)

We think that there is definitly some issue with the memory allocated for rawImage. In the above steps Griaule library alloted memory three times and pass it to ImageAcquired event. It seems that library internally not able to release the references of these allocated memory block and when startEnroll API called it reaccessing those pointers that have already been released.

Kindly respond urgently.

Regards,

Asif

c.almeida
Offline
Joined: 2011-02-14
Rate this post:
0
No votes yet

Dear Custommers,

       Because of the complexity of this issue, it have solved by e-mail and remote access in conjunction with our development team. The principal issue in this case was because the client was using an old version of our SDK. The related problems doens`t happen anymore in new versions. By the way, if you are having the same problem, please contact us in this same thread then we will work to solve your problem.

Best Regards

--

Carlos Almeida, W.

Griaule Support Team