![]() | Should I usually use destroy()? |
|
03 Jun 2012, 17:07
Damián Marcelo González (4 posts) |
Hi, I’m developing an application with this beautifull framework, had read the book by the way. I’m wondering if I should call destroy() in those widgets which I’ll not use anymore. |
|
17 Jun 2012, 12:29
Lars Kanis (1 post) |
The GC deletes the object, if it is no longer in use (as you described). Part of the deletion is the destruction of server side resources, removing the focus, etc. This is equal to what can be done explicitly by the FXWindow#destroy method, if you want a window to disappear from screen. The GC also deletes any client side resources (memory, parent/sibling connections, acceltable, recalc layout, etc.) and the Ruby object itself. So you usually don’t have to care about #destroy. To remove a FXWindow from screen or out of a surrounding frame you may call FXWindow#removeChild in the form fxwindow.parent.removeChild(fxwindow). This does immediate server and client side deletion as described above (but of course keeps the ruby object). Since this call isn’t very obvious, I was already thinking about adding a method FXWindow#delete that just calls C++ object destructor of the given object. |
|
17 Jun 2012, 13:30
Damián Marcelo González (4 posts) |
Thanks for your time Lars. Would be practice… |
| You must be logged in to comment |

