Kirix Support Forums

wxAUI's wxFrameManager not multiprocessor safe?

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

wxAUI's wxFrameManager not multiprocessor safe?

Postby jason on Sun Sep 03, 2006 2:31 pm

I'm working with wxWidgets 2.7.0 on an Athlon X2 dual core processor.


It seems there is a race between draging a wxFloatPane and having it docked. It seems that m_action_window is freed before its use in wxFrameManager::OnMotion on (m_action == actionDragFloatingPane). When m_action_window->Move() is called it crashes because the __vfptr is set to 0xfeeefeee, which is the value that NT's heap manager sets free'd memory.

I haven't worked with wxAUI enough yet to be familiar enough to fix the problem. :?

Is anyone at KIRIX testing wxAUI on a multiprocessor system?
jason
Registered User
 
Posts: 5
Joined: Sun Sep 03, 2006 2:14 pm

Fix

Postby jason on Sun Sep 03, 2006 4:28 pm

I believe I have a fix.

Change the check for actionDragFloatingPane in
void wxFrameManager::OnMotion(wxMouseEvent& event) to:

else if (m_action == actionDragFloatingPane)
{
if (m_action_window == NULL)
setAction(actionNone);
else {
wxPoint pt = m_frame->ClientToScreen(event.GetPosition());
m_action_window->Move(pt.x - m_action_offset.x,
pt.y - m_action_offset.y);
}
}



Add the check to set m_action_window to NULL in
void wxFrameManager::Update()

// reduce flicker
p.window->SetSize(1,1);

if (p.frame->IsShown())
p.frame->Show(false);

if (m_action_window == p.frame)
m_action_window = NULL;
jason
Registered User
 
Posts: 5
Joined: Sun Sep 03, 2006 2:14 pm

Return to wxAUI Questions, Thoughts & Feedback