Re: detach() for FXFont

[email protected]
Newsgroups gmane.comp.lib.fox-toolkit.user
Message-ID <[email protected]>
On 2021-10-01 15:30, John Selverian 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.