Thanks for replying Phil, thats a great point which I didn't think about. However 2 points<br> - Even if the QWebPage does not parent the QNetworkAccessManager, shouldn't it still hold a reference to it and keep it from getting deleted?<br>
- Even if the behavior is intended, under no circumstances should my example program1 crash Python.exe the way it does right now. Is there something wrong with the error handling code?<br><br><div class="gmail_quote">On Sat, Jan 9, 2010 at 1:33 AM, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Fri, 8 Jan 2010 22:54:36 -0800, Karthik Tharavaad<br>
<<a href="mailto:karthiktharavaad@gmail.com">karthiktharavaad@gmail.com</a>> wrote:<br>
</div><div><div></div><div class="h5">> in the same vein as the thread from yesterday. I get an error from this:<br>
><br>
> BEGIN PROGRAM-----------------<br>
><br>
> import sys<br>
> from PyQt4.QtGui import *<br>
> from PyQt4.QtCore import *<br>
> from PyQt4.QtWebKit import QWebView<br>
> from PyQt4.QtNetwork import QNetworkAccessManager<br>
><br>
> if __name__ == "__main__":<br>
> app = QApplication(sys.argv)<br>
> view = QWebView()<br>
> view.page().setNetworkAccessManager( QNetworkAccessManager() )<br>
> view.page().mainFrame().load( QUrl("<a href="http://www.google.com" target="_blank">http://www.google.com</a>") )<br>
> view.show()<br>
> sys.exit( app.exec_() )<br>
><br>
> ----------------------------------------------<br>
><br>
> This CRASHES upon running, while THIS<br>
><br>
><br>
> BEGIN PROGRAM-----------------<br>
><br>
> import sys<br>
> from PyQt4.QtGui import *<br>
> from PyQt4.QtCore import *<br>
> from PyQt4.QtWebKit import QWebView<br>
> from PyQt4.QtNetwork import QNetworkAccessManager<br>
><br>
> if __name__ == "__main__":<br>
> app = QApplication(sys.argv)<br>
> view = QWebView()<br>
> manager = QNetworkAccessManager() # ADDED LINE, CACHING manager<br>
> view.page().setNetworkAccessManager(manager)<br>
> view.page().mainFrame().load( QUrl("<a href="http://www.google.com" target="_blank">http://www.google.com</a>") )<br>
> view.show()<br>
> sys.exit( app.exec_() )<br>
><br>
> ----------------------------------------------<br>
><br>
> seems like when I create the QNetworkAccessManager(), it gets destroyed<br>
> right away after it gets added with setNetworkAccessManager(), however,<br>
> this<br>
> should not be the case since QNetworkAccessManager is a QObject and<br>
should<br>
> be properly parented to the QWebPage when its added<br>
<br>
</div></div><div><div></div><div class="h5">No it shouldn't. If that were the case how would you use a manager with<br>
more than one page?<br>
<br>
Phil<br>
</div></div></blockquote></div><br>