{"action":"created","issue":{"url":"https://api.github.com/repos/jaeandersson/swig/issues/47","labels_url":"https://api.github.com/repos/jaeandersson/swig/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/jaeandersson/swig/issues/47/comments","events_url":"https://api.github.com/repos/jaeandersson/swig/issues/47/events","html_url":"https://github.com/jaeandersson/swig/issues/47","id":105056285,"number":47,"title":"\"clear all\" now gives problems","user":{"login":"KrisThielemans","id":6362141,"avatar_url":"https://avatars.githubusercontent.com/u/6362141?v=3","gravatar_id":"","url":"https://api.github.com/users/KrisThielemans","html_url":"https://github.com/KrisThielemans","followers_url":"https://api.github.com/users/KrisThielemans/followers","following_url":"https://api.github.com/users/KrisThielemans/following{/other_user}","gists_url":"https://api.github.com/users/KrisThielemans/gists{/gist_id}","starred_url":"https://api.github.com/users/KrisThielemans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrisThielemans/subscriptions","organizations_url":"https://api.github.com/users/KrisThielemans/orgs","repos_url":"https://api.github.com/users/KrisThielemans/repos","events_url":"https://api.github.com/users/KrisThielemans/events{/privacy}","received_events_url":"https://api.github.com/users/KrisThielemans/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jaeandersson/swig/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-09-05T23:32:07Z","updated_at":"2015-09-06T19:40:27Z","closed_at":null,"body":"\"clear all\" used to work (although sometimes it caused a crash). now it gives me an error if I want to use my module after the clear all\r\n\r\n>Error using stirMATLAB_wrap\r\nGlobal type table deleted unexpectedly"},"comment":{"url":"https://api.github.com/repos/jaeandersson/swig/issues/comments/138117907","html_url":"https://github.com/jaeandersson/swig/issues/47#issuecomment-138117907","issue_url":"https://api.github.com/repos/jaeandersson/swig/issues/47","id":138117907,"user":{"login":"jaeandersson","id":2487645,"avatar_url":"https://avatars.githubusercontent.com/u/2487645?v=3","gravatar_id":"","url":"https://api.github.com/users/jaeandersson","html_url":"https://github.com/jaeandersson","followers_url":"https://api.github.com/users/jaeandersson/followers","following_url":"https://api.github.com/users/jaeandersson/following{/other_user}","gists_url":"https://api.github.com/users/jaeandersson/gists{/gist_id}","starred_url":"https://api.github.com/users/jaeandersson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaeandersson/subscriptions","organizations_url":"https://api.github.com/users/jaeandersson/orgs","repos_url":"https://api.github.com/users/jaeandersson/repos","events_url":"https://api.github.com/users/jaeandersson/events{/privacy}","received_events_url":"https://api.github.com/users/jaeandersson/received_events","type":"User","site_admin":false},"created_at":"2015-09-06T19:40:27Z","updated_at":"2015-09-06T19:40:27Z","body":"After some investigating, I'm starting to realise that it is not easy to get this to work without global memory...\r\n\r\nGot an idea though: might be possible to fix the \"clear all\" issue by replacing the global variable `swig_runtime_data_type_pointer4` with a static method inside `SwigRef`. This method would contain a persistent variable with the same information. According to MATLAB documentation, it should be possible to keep this in memory until MATLAB quits by also calling `mlock` inside the function."}}