Changeset 116 for smplayer/trunk/src


Ignore:
Timestamp:
Dec 14, 2011, 2:31:02 PM (14 years ago)
Author:
Silvan Scherrer
Message:

smplayer: prevent some gui hang

Location:
smplayer/trunk/src
Files:
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk/src/core.cpp

    r112 r116  
    2222#include <QRegExp>
    2323#include <QTextStream>
     24#include <QEventLoop>
    2425
    2526#include <cmath>
     
    22272228        }
    22282229
     2230#ifdef Q_OS_OS2
     2231        QEventLoop eventLoop;
     2232
     2233        connect(proc, SIGNAL(processExited()), &eventLoop, SLOT(quit()));
     2234
     2235        tellmp("quit");
     2236
     2237        QTimer::singleShot(5000, &eventLoop, SLOT(quit()));
     2238        eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
     2239
     2240        if (proc->isRunning()) {
     2241                qWarning("Core::stopMplayer: process didn't finish. Killing it...");
     2242                proc->kill();
     2243        }
     2244#else
    22292245    tellmp("quit");
    22302246   
     
    22342250                proc->kill();
    22352251        }
     2252#endif
    22362253
    22372254        qDebug("Core::stopMplayer: Finished. (I hope)");
Note: See TracChangeset for help on using the changeset viewer.