Hi Orson, Cirilo,

My source code on that case is different (since I am not using for that issue 
the model viewer but the 3d viewer canvas.. anyway.. should be the same problem)

Unfortunately, as Orson explained me, the way I solved it was not a proper 
allowed way of wxWidgets because I am forcing the delete of dialog (and it 
should be left to the wx manager)

I placed a "delete dlg;" after this line:
https://github.com/KiCad/kicad-source-mirror/blob/a4ba01f42d36aec1076fc0055628d53eca21a8f1/pcbnew/editmod.cpp#L69
That will call first the deletion and free of gl context (before it switchs to 
the context of pcbnew)

by now "it works for me" but we may come with a better solution that does not 
overrule the wxWidgets.

Mario
________________________________________
From: Kicad-developers 
[[email protected]] on behalf of 
Cirilo Bernardo [[email protected]]
Sent: 24 May 2016 10:33
To: Maciej Sumiński
Cc: KiCad Developers
Subject: Re: [Kicad-developers] PATCH: fix double-free bug in 3D model viewer

Thanks Orson,

 Perhaps this patch should be held back for now.  Mario reported that he fixed 
this problem in his new 3DViewer branch, but I don't know the details. 
Everything works of course if the GL context is not deleted but then we have a 
memory leak.

- Cirilo

_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to