ariya/phantomjs — pull request #302 by telaviv (2012-08-19 05:53:39+00:00)
Title: Remove premature WebPage deletion.

This reverts two commits:

5acaa6b42d510f529ea77507f678b114bac73d9c
8094cdb4e7d3179066eb3ecba581ec36baacdfee

Both commits attempt to overcome a bug with QtWebKit where WebPages needed to be destroyed before our QtApplication was destroyed. If this bug were not there then our QObject relations would handle the necessary cleanup for us. I looked back on the issues that led to the fix in the first place which are #136 #146 and #149. I couldn't reproduce the issues at all. For instance:

$ phantomjs loadspeed.js http://dl.dropbox.com/u/9451381/tmp/test1.html

Should lead to a segmentation fault, but it doesn't for me. This leads me to believe (perhaps naively) that this was fixed upstream for us. So in theory we should be able to remove the hack that is commit 5acaa6b42d510f529ea77507f678b114bac73d9c.

8094cdb4e7d3179066eb3ecba581ec36baacdfee alludes to wanting Phantom::exit to actually exit before running the rest of the code. I'm not sure if the intention is to have phantom.exit() be the last call in a script, but if it is then it currently isn't and we should create another issue for that.