My application crashes when dragging a floating window around, or while trying to resize a floating window.
I tried trim down the problem and now I'm in the situation that the sample application as it shown on the Wiki page and on other places does not even start, before seeing anything it crashes. It works fine on the other platforms.
The code I use that crashes immediately is:
Code: Select all
#include <wx/wx.h>
#include <wx/aui/aui.h>
class MyFrame : public wxFrame {
public:
MyFrame(wxWindow* parent) : wxFrame(parent, -1, _("wxAUI Test"),
wxDefaultPosition, wxSize(800,600),
wxDEFAULT_FRAME_STYLE)
{
// notify wxAUI which frame to use
m_mgr.SetManagedWindow(this);
// create several text controls
wxTextCtrl* text1 = new wxTextCtrl(this, -1, _("Pane 1 - sample text"),
wxDefaultPosition, wxSize(200,150),
wxNO_BORDER | wxTE_MULTILINE);
wxTextCtrl* text2 = new wxTextCtrl(this, -1, _("Pane 2 - sample text"),
wxDefaultPosition, wxSize(200,150),
wxNO_BORDER | wxTE_MULTILINE);
wxTextCtrl* text3 = new wxTextCtrl(this, -1, _("Main content window"),
wxDefaultPosition, wxSize(200,150),
wxNO_BORDER | wxTE_MULTILINE);
// add the panes to the manager
m_mgr.AddPane(text1, wxLEFT, wxT("Pane Number One"));
m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Number Two"));
m_mgr.AddPane(text3, wxCENTER);
// tell the manager to "commit" all the changes just made
m_mgr.Update();
}
~MyFrame()
{
// deinitialize the frame manager
m_mgr.UnInit();
}
private:
wxAuiManager m_mgr;
};
// our normal wxApp-derived class, as usual
class MyApp : public wxApp {
public:
bool OnInit()
{
wxFrame* frame = new MyFrame(NULL);
SetTopWindow(frame);
frame->Show();
return true;
}
};
DECLARE_APP(MyApp);
IMPLEMENT_APP(MyApp);
When trying to follow the stuff in the debugger with a version of wxWidgets compiled with debug information I come into the function/method:
void wxGUIEventLoop::OSXDoRun()
and in this function it calls:
[NSApp run];
I cannot enter this with debugger, the moment I try to enter it the application crashes.
Attached screenshots of the call stack and the threads. When the my more complex application crashes it is also always with the same message in strlen in the threads window. The call stack is then a bit different, but my feeling is that the underlying cause is the same.
I also build the aui demo from the samples directory, that is a far more complicated application as the simple example, but that one works fine on Mac!
I normally build against an own build wxWidgets from the 3.1.0 sources.
It is build after configuring it with the following command:
../configure --disable-shared --with-macosx-version-min=10.9 --enable-mediactrl=no --enable-monolithic --with-expat=builtin
Thus a static monolithic library and no media stuff, since that breaks the build.
Also other builds non monolithic and with debug info fails.
I tried both clang and the GNU gcc but no difference. I use Codelite as IDE.
I also cloned the latest code from github and build that version of wxWidgets all with the same result.
So if anyone has any suggestion on what is going on here and how to fix it, that would be very appreciated.