{"action":"created","issue":{"url":"https://api.github.com/repos/jbevain/cecil/issues/284","repository_url":"https://api.github.com/repos/jbevain/cecil","labels_url":"https://api.github.com/repos/jbevain/cecil/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/jbevain/cecil/issues/284/comments","events_url":"https://api.github.com/repos/jbevain/cecil/issues/284/events","html_url":"https://github.com/jbevain/cecil/issues/284","id":167516835,"number":284,"title":"Stream not closed?","user":{"login":"manu-silicon","id":13194660,"avatar_url":"https://avatars.githubusercontent.com/u/13194660?v=3","gravatar_id":"","url":"https://api.github.com/users/manu-silicon","html_url":"https://github.com/manu-silicon","followers_url":"https://api.github.com/users/manu-silicon/followers","following_url":"https://api.github.com/users/manu-silicon/following{/other_user}","gists_url":"https://api.github.com/users/manu-silicon/gists{/gist_id}","starred_url":"https://api.github.com/users/manu-silicon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manu-silicon/subscriptions","organizations_url":"https://api.github.com/users/manu-silicon/orgs","repos_url":"https://api.github.com/users/manu-silicon/repos","events_url":"https://api.github.com/users/manu-silicon/events{/privacy}","received_events_url":"https://api.github.com/users/manu-silicon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-26T04:05:54Z","updated_at":"2016-07-26T04:19:44Z","closed_at":"2016-07-26T04:19:44Z","body":"Just started to use the version from master and it seems that cecil keeps a lock on the assemblies it processes. I mean that I used to be able to delete some assemblies I had generated, but cannot anymore.\r\n\r\nI haven't been able to debug this further but wanted to check if some internals have changed that could explain this."},"comment":{"url":"https://api.github.com/repos/jbevain/cecil/issues/comments/235158865","html_url":"https://github.com/jbevain/cecil/issues/284#issuecomment-235158865","issue_url":"https://api.github.com/repos/jbevain/cecil/issues/284","id":235158865,"user":{"login":"jbevain","id":79284,"avatar_url":"https://avatars.githubusercontent.com/u/79284?v=3","gravatar_id":"","url":"https://api.github.com/users/jbevain","html_url":"https://github.com/jbevain","followers_url":"https://api.github.com/users/jbevain/followers","following_url":"https://api.github.com/users/jbevain/following{/other_user}","gists_url":"https://api.github.com/users/jbevain/gists{/gist_id}","starred_url":"https://api.github.com/users/jbevain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbevain/subscriptions","organizations_url":"https://api.github.com/users/jbevain/orgs","repos_url":"https://api.github.com/users/jbevain/repos","events_url":"https://api.github.com/users/jbevain/events{/privacy}","received_events_url":"https://api.github.com/users/jbevain/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T04:19:44Z","updated_at":"2016-07-26T04:19:44Z","body":"@manu-silicon that's intended. We're working on getting a beta of 0.10 out of the door. Here's the relevant entry for the changelog:\r\n\r\n### Lower Memory Usage\r\n\r\nCecil used to read all assemblies in memory which had a severe impact on memory when reading large assemblies or assemblies with large resources. Now, by default, a `ModuleDefinition` keeps an open handle on its file and *needs to be disposed*. The default behavior for a `DefaultAssemblyResolver`, which is caching, is to dispose all cached assemblies when the resolver is disposed.\r\n\r\nYou may override that by setting the `InMemory = true` of the `ReaderParameters`, but that will lead to more memory fragmentation.\r\n\r\nBecause of this, if you were previously reading and writing an assembly on the same file, you need to change how you read and write your assembly to:\r\n\r\n```csharp\r\n// ReaderParameters { ReadWrite = true } is necessary to later write the file\r\nusing (var module = ModuleDefinition.ReadModule(file, new ReaderParameters { ReadWrite = true })) \r\n{\r\n    // Modify the assembly\r\n\r\n    module.Write (); // Write to the same file that was used to open the file\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"jbevain"}}