-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rework setUrl wait on eventloop #92
Conversation
Codecov Report
@@ Coverage Diff @@
## master #92 +/- ##
==========================================
+ Coverage 77.22% 77.29% +0.06%
==========================================
Files 18 18
Lines 1032 1035 +3
Branches 107 107
==========================================
+ Hits 797 800 +3
- Misses 202 203 +1
+ Partials 33 32 -1
Continue to review full report at Codecov.
|
@itziakos -- just for my clarity can you please provide a bit more information as to why you are making this change? I can see that |
Sorry, I created the PR in a haste. On an internal application we have been experiencing segfaults on windows. I tracked down the segault and it was taking place inside Fault handler output Current thread 0x00001f90 (most recent call first):
File "build\bdist.win-amd64\egg\jigna\core\proxy_qwebview.py", line 131 in setUrl
File "build\bdist.win-amd64\egg\jigna\qt_server.py", line 82 in __init__
File "build\bdist.win-amd64\egg\jigna\html_widget.py", line 71 in _create_server
File "build\bdist.win-amd64\egg\jigna\html_widget.py", line 38 in __init__ It is not totally clear why it would segfault at this place but the stack trace was pointing to happening in response to the load Finished event stack trace
I played around with the code a little and it looks that using a local variable versus an instance attribute was enough to stop the segfault (I also took the opportunity to tidy up the code). It could be something related to pyside 1.2.2 (python 2.7) but I did not have much time/luck into investigating further. |
I am still not sure that this is actually the real problem, but I thought that the changes are generally positive so I submitted the PR |
@prabhuramachandran is this ok to merge? |
Thanks for all the details! That was helpful. Yes, I think it should be fine to merge. A test case would be nice if possible but I am not sure how hard it would be to create or if it is going to be a bit too much to ask for. I asked because I was just curious about the origin of the PR. Thanks! |
Yes, it is tricky. I have not had much luck so far. I will try to get some time and give it another go. |
@itziakos -- please merge it if the test case is too much of a bother. |
I did not have time look at it yet |
@prabhuramachandran I have not been able to replicate the specific segfault with a small test. However, in the process I found another segfault. The following code will result in a sefault on exit (python 2.7.13 and pyside 1.2.2) import unittest
import faulthandler
from jigna.qt import QtCore, QtGui
from jigna.core.proxy_qwebview import ProxyQWebView
faulthandler.enable()
class TestProxyQWebview(unittest.TestCase):
def setUp(self):
self.app = QtGui.QApplication.instance() or QtGui.QApplication([])
def test_setUrl(self):
app = self.app
def create():
widget = ProxyQWebView()
widget.show()
widget.setUrl(QtCore.QUrl('https://www.enthought.com'))
print 'DONE'
QtCore.QTimer.singleShot(10, create)
QtCore.QTimer.singleShot(10000, app.quit)
print 'Start'
app.exec_() I would expect that just quitting the application should not segfault. |
opened issue #93 |
This PR reworks the code to make sure that the events are disconnected.
Details:
_loaded