Crash with wxAUI

  • Jarkko Lempiainen

    I bumped into a crash with wxPropertyGrid & wxAUI when having a property grid on a floating wxAUI pane. I noticed that wxPropertyGrid caches the top level parent (m_tlp member variable) upon construction, and if it's constructed on a floating pane and the pane is closed after, then the m_tlp is invalidated. Closing an wxAUI pane is supposed to only hide the pane, but apparently the enclosing window is destroyed instead when the window is floating. Shouldn't m_tlp be initialized with the parent you pass to the wxPropertyGrid constructor instead?

    • Jarkko Lempiainen

      When I replaced m_tlp=::wxGetTopLevelParent(this); with m_tlp=GetParent(); it seems to fix it and property grid seems to also function properly otherwise as well after a quick test. What's the purpose of m_tlp exactly?

      • Jaakko Salli

        Jaakko Salli - 2009-05-30

        Top-level parent (m_tlp) is hooked with event handler to prevent it from being closed if property has invalid value. I'm pretty sure close events are only sent to top-level windows, so just using the parent will not work properly.

        I will try to come up with a solution that will not break any old behavior. Reimplementing Reparent(), assuming it is virtual, might work for some cases (maybe even yours, if you did not have intermediate window/panel).


    • Jarkko Lempiainen

      I changed the offending wxAUI panes in my app to wxMiniFrame for other reasons, so it'n not a blocking issue for me anymore (for now).

      Cheers, Jarkko


Log in to post a comment.