{"action":"created","issue":{"url":"https://api.github.com/repos/amir20/phantomjs-node/issues/361","repository_url":"https://api.github.com/repos/amir20/phantomjs-node","labels_url":"https://api.github.com/repos/amir20/phantomjs-node/issues/361/labels{/name}","comments_url":"https://api.github.com/repos/amir20/phantomjs-node/issues/361/comments","events_url":"https://api.github.com/repos/amir20/phantomjs-node/issues/361/events","html_url":"https://github.com/amir20/phantomjs-node/issues/361","id":134295649,"number":361,"title":"Unable to render one page after first one got closed","user":{"login":"janober","id":6249596,"avatar_url":"https://avatars.githubusercontent.com/u/6249596?v=3","gravatar_id":"","url":"https://api.github.com/users/janober","html_url":"https://github.com/janober","followers_url":"https://api.github.com/users/janober/followers","following_url":"https://api.github.com/users/janober/following{/other_user}","gists_url":"https://api.github.com/users/janober/gists{/gist_id}","starred_url":"https://api.github.com/users/janober/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janober/subscriptions","organizations_url":"https://api.github.com/users/janober/orgs","repos_url":"https://api.github.com/users/janober/repos","events_url":"https://api.github.com/users/janober/events{/privacy}","received_events_url":"https://api.github.com/users/janober/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-17T14:34:16Z","updated_at":"2016-02-17T16:07:22Z","closed_at":null,"body":"Hi,\r\n\r\njust gave the new version (2.0.0-alpha.1) a spin and I am somehow totally unable to render a page after the first one got closed.\r\n\r\nSo I want to use the same PhantomJS instance and render multiple pages with it. But somehow after one page got closed I am unable to create another page. Here a simple example:\r\n\r\n```\r\nvar phantom = require('phantom');\r\n\r\nphantom.create().then(function(ph) {\r\n\r\n  console.log('Render first');\r\n  ph.createPage().then(function(page) {\r\n    page.open('https://stackoverflow.com/').then(function(status) {\r\n      console.log('done1: ' + status);\r\n      page.close();\r\n    });\r\n  });\r\n\r\n  setTimeout(function() {\r\n    console.log('Render second');\r\n    ph.createPage().then(function(page) {\r\n      page.open('https://stackoverflow.com/').then(function(status) {\r\n        console.log('done2: ' + status);\r\n        page.close();\r\n        ph.exit();\r\n      });\r\n    });\r\n  }, 3000);\r\n\r\n});\r\n```\r\n\r\nOutput will be:\r\n```\r\nRender first\r\ndone1: success\r\nRender second\r\n```\r\nand then it simply sits there. Any idea what is going on there?"},"comment":{"url":"https://api.github.com/repos/amir20/phantomjs-node/issues/comments/185274335","html_url":"https://github.com/amir20/phantomjs-node/issues/361#issuecomment-185274335","issue_url":"https://api.github.com/repos/amir20/phantomjs-node/issues/361","id":185274335,"user":{"login":"amir20","id":260667,"avatar_url":"https://avatars.githubusercontent.com/u/260667?v=3","gravatar_id":"","url":"https://api.github.com/users/amir20","html_url":"https://github.com/amir20","followers_url":"https://api.github.com/users/amir20/followers","following_url":"https://api.github.com/users/amir20/following{/other_user}","gists_url":"https://api.github.com/users/amir20/gists{/gist_id}","starred_url":"https://api.github.com/users/amir20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amir20/subscriptions","organizations_url":"https://api.github.com/users/amir20/orgs","repos_url":"https://api.github.com/users/amir20/repos","events_url":"https://api.github.com/users/amir20/events{/privacy}","received_events_url":"https://api.github.com/users/amir20/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T16:07:22Z","updated_at":"2016-02-17T16:07:22Z","body":"This makes sense. I only allow one page instance per process. Short term solution would be to not call `page.close()`. \r\n\r\nNow for the real bug. According to the documentation, `page.close()` cleans up memory. It sounded optional to dispose the page. \r\n\r\nI can fix this by creating a new page per session. Do you think that your use case is common? "}}