Skip to content

Commit

Permalink
Merge pull request ariya#85 from Roejames12/master
Browse files Browse the repository at this point in the history
Make sure phantom.exit() really exits.
  • Loading branch information
ariya committed Jun 21, 2011
2 parents 8094cdb + 49b630b commit 77414c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/pyphantomjs/phantom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import os
import sys

import sip
from PyQt4.QtCore import pyqtProperty, pyqtSlot, QObject, \
QFile
from PyQt4.QtGui import QApplication
Expand Down Expand Up @@ -118,6 +119,12 @@ def defaultPageSettings(self):
def exit(self, code=0):
self.m_terminated = True
self.m_returnValue = code

# stop javascript execution; delete C++ object first,
# then delete the Python reference
sip.delete(self.m_page)
del self.m_page

QApplication.instance().exit(code)

@pyqtSlot(str, result=bool)
Expand Down

0 comments on commit 77414c0

Please sign in to comment.