← Back to team overview

kicad-developers team mailing list archive

Mac & crash on quit.

 

I've found some problems in eeschema,gerbview and pcbnew closing the application 
(follows proposal of patch for eeschema and applicable to all the other).
Seems that there is a spurious OnPaint event after the destroy of WinEDA_SchematicFrame.
That is handled by WinEDA_DrawPanel that relies on a virtual function that is no more 
avaiable.

0 fr.inpg.lis.eeschema 0x0036b569 wxStringData::IsEmpty() const + 9 (string.h:226)
1 fr.inpg.lis.eeschema 0x0036b589 wxStringData::Unlock() + 17 (string.h:243)
2 fr.inpg.lis.eeschema 0x0036b691 wxStringBase::~wxStringBase [not-in-charge]() + 
25 (string.h:397)
3 fr.inpg.lis.eeschema 0x0036b70d wxString::~wxString [in-charge]() + 17(string.h:
660)
4 fr.inpg.lis.eeschema 0x00370260 wxMessageDialog::~wxMessageDialog [in-charge]
() + 44 (msgdlg.h:26)
5 fr.inpg.lis.eeschema 0x00038714 WinEDA_DrawPanel::ReDraw(wxDC*, bool) + 540 
(drawpanel.cpp:557)
6 fr.inpg.lis.eeschema 0x00038942 WinEDA_DrawPanel::OnPaint(wxPaintEvent&) + 516 
(drawpanel.cpp:506)
7 fr.inpg.lis.eeschema 0x0014f874 wxEvtHandler::ProcessEventIfMatches
(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 108
8 fr.inpg.lis.eeschema 0x0014fa0b wxEventHashTable::HandleEvent(wxEvent&, 
wxEvtHandler*) + 103
9 fr.inpg.lis.eeschema 0x0014fe8f wxEvtHandler::ProcessEvent(wxEvent&) +183
10 fr.inpg.lis.eeschema 0x0014fe35 wxEvtHandler::ProcessEvent(wxEvent&) +93
11 fr.inpg.lis.eeschema 0x00183347 wxScrollHelperEvtHandler::ProcessEvent(wxEvent&) 
+ 39
12 fr.inpg.lis.eeschema 0x00125ba2 wxWindow::MacDoRedraw(void*, long) + 1190
13 fr.inpg.lis.eeschema 0x00124255 wxMacWindowControlEventHandler
(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 1001
14 fr.inpg.lis.eeschema 0x0012488f wxMacWindowEventHandler
(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 609
15 com.apple.HIToolbox 0x92dec537 DispatchEventToHandlers(EventTargetRec*, 
OpaqueEventRef*, HandlerCallRec*) + 1093
[...]
46 com.apple.HIToolbox 0x930a8dd8 WindowDefHideToolbar(WindowData*, 
unsigned char) + 144
47 fr.inpg.lis.eeschema 0x001ba786 wxToolBar::MacInstallNativeToolbar(bool) + 428
48 fr.inpg.lis.eeschema 0x001ba96d wxToolBar::~wxToolBar [not-in-charge]() + 113
49 fr.inpg.lis.eeschema 0x00375533 WinEDA_Toolbar::~WinEDA_Toolbar [in-charge 
deleting]() + 39 (wxstruct.h:1627)
50 fr.inpg.lis.eeschema 0x0017aba0 wxFrameBase::DeleteAllBars() + 84
51 fr.inpg.lis.eeschema 0x0017bbdc wxFrame::~wxFrame [not-in-charge]() + 40
52 fr.inpg.lis.eeschema 0x000da12d WinEDA_BasicFrame::~WinEDA_BasicFrame [not-in-
charge]() + 165 (basicframe.cpp:55)
53 fr.inpg.lis.eeschema 0x0003190a WinEDA_DrawFrame::~WinEDA_DrawFrame [not-
in-charge]() + 150 (drawframe.cpp:116)
54 fr.inpg.lis.eeschema 0x00034809 
WinEDA_SchematicFrame::~WinEDA_SchematicFrame [in-charge deleting]() + 77 
(schframe.cpp:159)
[,,,]

Index: share/drawpanel.cpp
=======================================================
============
--- share/drawpanel.cpp (revision 381)
+++ share/drawpanel.cpp (working copy)
@@ -554,7 +554,9 @@
 
DC->SetBackground( *wxBLACK_BRUSH );
DC->SetBackgroundMode( wxTRANSPARENT );
- m_Parent->RedrawActiveWindow( DC, erasebg );
+
+ if(m_Parent->GetEventHandler()->GetEvtHandlerEnabled())
+ m_Parent->RedrawActiveWindow( DC, erasebg );
}
 
 
Index: eeschema/schframe.cpp
=======================================================
============
--- eeschema/schframe.cpp (revision 381)
+++ eeschema/schframe.cpp (working copy)
@@ -154,6 +154,7 @@
 
WinEDA_SchematicFrame::~WinEDA_SchematicFrame()
{
+ this->GetEventHandler()->SetEvtHandlerEnabled(false);
m_Parent->m_SchematicFrame = NULL;
m_CurrentScreen = ScreenSch;
}