It would be possible to have a binded event that gets called just before the canvas is destroyed as a last event?
Often you have to set some memory using SetGadgetData() that needs to be freed when the gadget is destroyed.
Doing it manually is not reliable when the gadget is not explicitly freed by you.
Canvas #PB_EventType_Destroy
Re: Canvas #PB_EventType_Destroy
On Windows you can make it with a Callback... Like AddEvents
Re: Canvas #PB_EventType_Destroy
Thanks, I know it can be done with the api, windows and linux are easy, mac more difficult although it can be done, a native solution is needed.
Re: Canvas #PB_EventType_Destroy
I agree it could useful when using custom data. Probably for all gadgets as well.
Re: Canvas #PB_EventType_Destroy
Great, hopefully in the next version
Re: Canvas #PB_EventType_Destroy
Perhaps better a SetFreeGadgetCallback 
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Canvas #PB_EventType_Destroy
Yes that sounds better, my attemp fails in some apple systems
Re: Canvas #PB_EventType_Destroy
❤Fred wrote: Sun Sep 29, 2024 4:59 pm I agree it could useful when using custom data. Probably for all gadgets as well.
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits