From 9fee931d6d303924c050d78740c3c9cc40ce4cd8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 Feb 2016 02:22:25 +0100 Subject: [PATCH] Work around a crash in wxGTK3 GUI test suite The tests crashed after running ModalDialogsTestCase::FileDialog() because the next call to wxYield() resulted in the completion of an async operation launched by the native file dialog which tried to dereference the already destroyed dialog. --- tests/controls/dialogtest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/controls/dialogtest.cpp b/tests/controls/dialogtest.cpp index bc65c2f0ac..3c2decde87 100644 --- a/tests/controls/dialogtest.cpp +++ b/tests/controls/dialogtest.cpp @@ -79,6 +79,13 @@ void ModalDialogsTestCase::FileDialog() CPPUNIT_ASSERT_EQUAL((int)wxID_OK, rc); CPPUNIT_ASSERT_EQUAL("test.txt", dlg.GetFilename()); + +#ifdef __WXGTK3__ + // The native file dialog in GTK+ 3 launches an async operation which tries + // to dereference the already deleted dialog object if we don't let it to + // complete before leaving this function. + wxYield(); +#endif }