[mythtv] [PATCH] mythvideo crash on exit (was Mythvideo compiling on Mac OS X? and keypresses in VideoManager)

Jeremiah Morris jm at whpress.com
Fri Nov 12 17:52:29 UTC 2004


On 12 Nov 2004, at 11:39 AM, Isaac Richards wrote:
>> Mythvideo isn't unlocking Qt before it exits.  The attached patch 
>> calls
>> qApp->unlock() at the end of mythvideo's mythplugin_run(), which 
>> allows
>> it to exit without error messages.
>
> Where's it locking it, though?  I don't see why this is necessary..

In runMenu(), the plugin does:

...
qApp->unlock();
diag->exec();
qApp->lock();
...

I don't think the application is locked coming into this code.  In 
constrast, mythfrontend seems to call lock(), then unlock(), then 
exec's the GUI stuff.   The unlock, do something, lock pattern is used 
in other places for a different purpose, so maybe this is just an 
incorrect use of copy-and-paste, and the runMenu() should instead be:

...
qApp->lock();
qApp->unlock();
diag->exec();
....

in which case the final unlock that I added would not be necessary.  
I'm not a Qt expert, but this change works for me and makes more sense.

- Jeremiah

Index: main.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/main.cpp,v
retrieving revision 1.38
diff -u -r1.38 main.cpp
--- main.cpp    23 Oct 2004 20:01:56 -0000      1.38
+++ main.cpp    12 Nov 2004 17:50:34 -0000
@@ -147,9 +147,9 @@
          if (class LCD * lcd = LCD::Get())
              lcd->switchToTime();

+        qApp->lock();
          qApp->unlock();
          diag->exec();
-        qApp->lock();
      }
      else
      {



More information about the mythtv-dev mailing list