← Back to team overview

kicad-developers team mailing list archive

Re: Fix in LIB_LOGGER to avoid Kicad crash on exit. Need review.

 

Hi JP,

On OSX (at least), when the LIB_LOGGER goes out of scope its super-class’s destructor is called, which calls Flush().  So the bug is just that the SetActiveTarget( m_previousLogger) is inside the if( m_bHasMessages ) block when it shouldn’t be.

That being said, your code is less dependent on the specifics of how wxWidgets currently works, so it's more robust.  I’m good with it.

Cheers,
Jeff.


> On 14 Jul 2019, at 18:06, jp charras <jp.charras@xxxxxxxxxx> wrote:
> 
> Hi Jeff,
> 
> Could you have a look into my commit 9259f3a7.
> 
> It fixes a crash on Windows on Kicad exit, if libedit was opened during
> a session.
> 
> I am thinking it was due to the fact wxLog::SetActiveTarget( this ) was
> called, but after deleting libedit (and therefore the created LIB_LOGGER
> ) wxLog was pointing a deleted LIB_LOGGER
> (wxLog::SetActiveTarget( m_previousLogger ) is never called if no error
> displayed)
> 
> I am thinking my code works, but I need your opinion, because this is
> your code and I am not specialist of wxLog.
> 
> Thanks.
> 
> -- 
> Jean-Pierre CHARRAS
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


Follow ups

References