{"id":293,"date":"2011-02-28T20:34:17","date_gmt":"2011-02-28T20:34:17","guid":{"rendered":"http:\/\/www.themissingdocs.net\/wordpress\/?p=293"},"modified":"2011-02-28T20:34:17","modified_gmt":"2011-02-28T20:34:17","slug":"gc-suppressfinalize-and-contextboundobject","status":"publish","type":"post","link":"https:\/\/www.themissingdocs.net\/?p=293","title":{"rendered":"GC.SuppressFinalize and ContextBoundObject"},"content":{"rendered":"<p>I think this is a bit of an interesting combination &#8211; SuppressFinalize works on a specific object telling the garbage collector not to call the finalize method and context bound object means that references to that object are remoting proxies, so there are technically multiple objects which could be the one that the runtime calls finalize on.<\/p>\n<p>Edit: Turns out I made a mistake in my original analysis (rather of silly of me, running different pieces of code on the different versions of .Net runtime), apparently GC.SuppressFinalize has never worked in a way which is useful with ContextBoundObject.\u00a0 However the Windows 7 SP1 change now means that the finalizer is called via the proxy, not magically directly on the underlying object.\u00a0 So if you had code for intercepting calls via the proxy and it didn&#8217;t handle the finalizer (because previously it didn&#8217;t have to), you have a new code path to which could go horribly wrong&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think this is a bit of an interesting combination &#8211; SuppressFinalize works on a specific object telling the garbage collector not to call the finalize method and context bound object means that references to that object are remoting proxies, so there are technically multiple objects which could be the one that the runtime calls &hellip; <a href=\"https:\/\/www.themissingdocs.net\/?p=293\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">GC.SuppressFinalize and ContextBoundObject<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-293","post","type-post","status-publish","format-standard","hentry","category-net-stuff"],"_links":{"self":[{"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=\/wp\/v2\/posts\/293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=293"}],"version-history":[{"count":0,"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=\/wp\/v2\/posts\/293\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.themissingdocs.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}