[Sumover-dev] [Media Tools] #166: Make vic respond to WM_QUIT messages on Windows

Media Tools SUMOVER-dev at cs.ucl.ac.uk
Wed Nov 21 18:35:14 GMT 2007


#166: Make vic respond to WM_QUIT messages on Windows
-------------------------+--------------------------------------------------
 Reporter:  turam        |       Owner:  piers 
     Type:  enhancement  |      Status:  new   
 Priority:  minor        |   Milestone:        
Component:  vic          |     Version:  4.2.27
 Keywords:               |  
-------------------------+--------------------------------------------------
 On Windows, if a WM_QUIT is sent to vic, it should respond by shutting
 down, but does not.  This is analogous to sending a SIGINT on Linux, which
 allows the application to shut down properly.  Properly, in this case,
 means sending an RTCP 'bye' message.

 The following patch changes the main loop on Windows so that it regularly
 checks for and handles WM_QUIT messages.  The main loop code for non-
 Windows platforms is unaffected.

 --- main.cpp    (revision 4109)
 +++ main.cpp    (working copy)
 @@ -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);
  }

-- 
Ticket URL: <https://mediatools.cs.ucl.ac.uk/nets/mmedia/ticket/166>
Media Tools <http://www-mice.cs.ucl.ac.uk/multimedia/software>
Media Tools


More information about the Sumover-dev mailing list