[Sumover-dev] [svn commit] r4111 - vic/branches/mpeg4

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Wed Dec 5 23:34:56 GMT 2007


Author: turam
Date: Wed Dec  5 23:34:51 2007
New Revision: 4111

Modified:
   vic/branches/mpeg4/main.cpp

Log:
Windows only:  Allow vic to shutdown when it receives a WM_QUIT message

Modified: vic/branches/mpeg4/main.cpp
==============================================================================
--- vic/branches/mpeg4/main.cpp	(original)
+++ vic/branches/mpeg4/main.cpp	Wed Dec  5 23:34:51 2007
@@ -466,6 +466,10 @@
 
 int main(int argc, const char** argv)
 {
+#ifdef WIN32
+	MSG msg;
+#endif
+
 #ifdef __FreeBSD__
 	srandomdev(); //SV-XXX: FreeBSD
 #else
@@ -835,8 +839,20 @@
 				Tk_DoOneEvent(0);
 	}
 #else
+#ifdef WIN32
+	while(1) {
+		Tcl_DoOneEvent(0);
+		if(PeekMessage(&msg, NULL, WM_QUIT,WM_QUIT, PM_NOREMOVE)) {
+			if (msg.message == WM_QUIT)
+			{
+				break;
+			}
+		}
+	}
+#else
 	Tk_MainLoop();
 #endif
+#endif
 	adios();
 	return (0);
 }



More information about the Sumover-dev mailing list