Re: detach() for FXFont
"John Selverian" <[email protected]>
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Organization | JAHM Software |
| Message-ID | <[email protected]> |
I only have to call detach() on Windows on either the main window or a non-modal window. On modal windows I do not need to call detach() prevent a leak. -----Original Message----- From: [email protected] <[email protected]> Sent: Monday, October 4, 2021 3:23 PM Cc: [email protected] Subject: Re: [Foxgui-users] detach() for FXFont On 2021-10-01 15:30, John wrote: > In my destructor I have this code: > > > > In windows if I do not call detach() I have a memory leak, when I call > detach() in Linux or OS X I get a segmentation fault. > > > > Why the different behavior? > > > > > > if (_boldFont != nullptr) > > { > > if (_programVersionType == > VERSION_TYPE::WINDOWS_VERSION) > > { > > _boldFont->detach(); // causes linux & OSX to > bomb when exiting > > } > > _boldFont->destroy(); > > delete _boldFont; > > } > ======================= It appears that FXFont::detach() behaves wrongly. Theory: detach() removes connection between widget and its server-resident resources. Clearly, FXFont doesn't do this. So its not working right. -- JVZ