367 views
in System Integration by

Hello,

when calling EwFreeBitmap an exception occurs at EwUpdateViewer

I created my own Extern Bitmap class which does not use a name to load an Extern Bitmap, but an ID or an handle of an already created Bitmap. 

The code is nearly the same as in the provided ExternBitmap class. When loading or reloading an Image the current displayed Extern Bitmap Handle gets freed and a new one will be loaded.

In my program it is possible that the Image has changed in the Device. Therefore a new Bitmap is created in the Device Driver (similar to EwLoadExternBitmap) while the current Bitmap is still displayed. The handle of the new Bitmap is Input of  the load function, where the current Bitmap gets freed. Then the Extern Bitmap Handle is set with the Input Handle.

The exception occurs when a new Bitmap is created and the old one should be deleted.

Can you help me to understand this error?

Best regards Jonas

 

1 Answer

0 votes
by

Hello Jonas,

I suppose the bitmap is freed twice. Usually if the bitmap is handed over to the GUI application it should not be necessary to free the bitmap explicitly by using EwFreeBitmap(). The bitmap is below the control of GUI application and it will be released automatically when it is not in use anymore. The function EwLoadExternBitmap() should only return a new bitmap with new content.

Can you try to remove the invocation of EwFreeBitmap()?

Best regards

Paul Banach

 

by

Thanks for your reply. As you said EwFreeBitmap() was called twice. There was a free in a deprecated section i forgot to remove before vacation. broken heart

 

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...