diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp index d617e71f9..973b23c0c 100644 --- a/modules/highgui/src/window_QT.cpp +++ b/modules/highgui/src/window_QT.cpp @@ -499,7 +499,7 @@ CV_IMPL void cvDestroyWindow(const char* name) CV_IMPL void cvDestroyAllWindows() { if (!guiMainThread) - CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" ); + return; QMetaObject::invokeMethod(guiMainThread, "destroyAllWindow", diff --git a/modules/highgui/test/test_gui.cpp b/modules/highgui/test/test_gui.cpp index 8704f68e1..285203cb0 100644 --- a/modules/highgui/test/test_gui.cpp +++ b/modules/highgui/test/test_gui.cpp @@ -58,6 +58,9 @@ void Foo(int /*k*/, void* /*z*/) {} void CV_HighGuiOnlyGuiTest::run( int /*start_from */) { + ts->printf(ts->LOG, "GUI 0\n"); + cvDestroyAllWindows(); + ts->printf(ts->LOG, "GUI 1\n"); namedWindow("Win");