diff --git a/python/pyphantomjs/phantom.py b/python/pyphantomjs/phantom.py index 4cd53638..b45ae6b7 100644 --- a/python/pyphantomjs/phantom.py +++ b/python/pyphantomjs/phantom.py @@ -99,6 +99,7 @@ class Phantom(QObject): def _exit(self, code): self.m_terminated = True self.m_returnValue = code + QApplication.instance().exit(code) @pyqtProperty('QStringList') def args(self): diff --git a/src/phantom.cpp b/src/phantom.cpp index 77223312..fadbeeab 100644 --- a/src/phantom.cpp +++ b/src/phantom.cpp @@ -229,6 +229,7 @@ void Phantom::_exit(int code) { m_terminated = true; m_returnValue = code; + QApplication::instance()->exit(code); } bool Phantom::injectJs(const QString &jsFilePath) {