From 56fbcc541f4e8fb8248bbf0973cc1c6e7da423d9 Mon Sep 17 00:00:00 2001 From: Ilya Lysenkov Date: Wed, 30 Jan 2013 15:25:10 +0400 Subject: [PATCH 1/2] Tested cvDestroyAllWindows() without windows --- modules/highgui/test/test_gui.cpp | 3 +++ 1 file changed, 3 insertions(+) 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"); From 3c8787980c53da2afeafd1a7c09ff853aedb6b33 Mon Sep 17 00:00:00 2001 From: Ilya Lysenkov Date: Wed, 30 Jan 2013 15:26:49 +0400 Subject: [PATCH 2/2] Fixed cvDestroyAllWindows() without windows in QT (#2440) --- modules/highgui/src/window_QT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",