{"action":"created","issue":{"url":"https://api.github.com/repos/svaarala/duktape/issues/108","labels_url":"https://api.github.com/repos/svaarala/duktape/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/svaarala/duktape/issues/108/comments","events_url":"https://api.github.com/repos/svaarala/duktape/issues/108/events","html_url":"https://github.com/svaarala/duktape/issues/108","id":54724226,"number":108,"title":"Finalization issue, telling when an object has been GC'd","user":{"login":"JoshEngebretson","id":376203,"avatar_url":"https://avatars.githubusercontent.com/u/376203?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshEngebretson","html_url":"https://github.com/JoshEngebretson","followers_url":"https://api.github.com/users/JoshEngebretson/followers","following_url":"https://api.github.com/users/JoshEngebretson/following{/other_user}","gists_url":"https://api.github.com/users/JoshEngebretson/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshEngebretson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshEngebretson/subscriptions","organizations_url":"https://api.github.com/users/JoshEngebretson/orgs","repos_url":"https://api.github.com/users/JoshEngebretson/repos","events_url":"https://api.github.com/users/JoshEngebretson/events{/privacy}","received_events_url":"https://api.github.com/users/JoshEngebretson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/svaarala/duktape/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/svaarala/duktape/milestones/9","html_url":"https://github.com/svaarala/duktape/milestones/v1.3.0","labels_url":"https://api.github.com/repos/svaarala/duktape/milestones/9/labels","id":1037290,"number":9,"title":"v1.3.0","description":"Buffer bindings, duk_config.h, bytecode dump/load","creator":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":51,"state":"open","created_at":"2015-03-24T22:16:58Z","updated_at":"2015-08-24T22:07:49Z","due_on":null,"closed_at":null},"comments":25,"created_at":"2015-01-19T03:59:27Z","updated_at":"2015-08-24T23:05:34Z","closed_at":null,"body":"I have objects with native class instances bound and need to know when the object has been garbage collected and will no longer be referenced in script.\r\n\r\nThe initial approach has been to use a finalizer.  However, this is problematic as the objects are being rescued outside of the finalizer.  I understand that this can happen, as the guide says \"this may happen in special cases even when the object is not rescued by the finalizer\".  I am not sure what this means.\r\n\r\nI am wondering if there is any reliable way to tell if an object has been GC'd.  (I am using heapptr native side to track the script objects)\r\n\r\nThanks!\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/svaarala/duktape/issues/comments/134406878","html_url":"https://github.com/svaarala/duktape/issues/108#issuecomment-134406878","issue_url":"https://api.github.com/repos/svaarala/duktape/issues/108","id":134406878,"user":{"login":"fatcerberus","id":4097841,"avatar_url":"https://avatars.githubusercontent.com/u/4097841?v=3","gravatar_id":"","url":"https://api.github.com/users/fatcerberus","html_url":"https://github.com/fatcerberus","followers_url":"https://api.github.com/users/fatcerberus/followers","following_url":"https://api.github.com/users/fatcerberus/following{/other_user}","gists_url":"https://api.github.com/users/fatcerberus/gists{/gist_id}","starred_url":"https://api.github.com/users/fatcerberus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatcerberus/subscriptions","organizations_url":"https://api.github.com/users/fatcerberus/orgs","repos_url":"https://api.github.com/users/fatcerberus/repos","events_url":"https://api.github.com/users/fatcerberus/events{/privacy}","received_events_url":"https://api.github.com/users/fatcerberus/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T23:05:34Z","updated_at":"2015-08-24T23:05:34Z","body":"If I had to guess at the cause of this, I would say there's a refcounting error somewhere, e.g. a corresponding DECREF coming before an INCREF (instead of after) which causes the object to be finalized and then immediately rescued."}}