{"id":5066,"date":"2019-04-11T12:00:44","date_gmt":"2019-04-11T04:00:44","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=5066"},"modified":"2019-04-14T18:26:18","modified_gmt":"2019-04-14T10:26:18","slug":"%e6%95%99%e7%a8%8b%e6%a0%88%e4%b8%8a%e6%8e%a5%e5%8f%a3%e5%af%b9%e8%b1%a1%e5%9c%a8%e5%8c%bf%e5%90%8d%e5%87%bd%e6%95%b0%e4%b8%ad%e7%9a%84%e4%bd%bf%e7%94%a8%e6%97%b6%e8%af%b7%e6%b3%a8%e6%84%8f%e5%86%85","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=5066","title":{"rendered":"[\u6559\u7a0b]\u6808\u4e0a\u63a5\u53e3\u5bf9\u8c61\u5728\u533f\u540d\u51fd\u6570\u4e2d\u7684\u4f7f\u7528\u65f6\u8bf7\u6ce8\u610f\u5185\u5b58\u6cc4\u9732\u95ee\u9898"},"content":{"rendered":"\n<p>\u9996\u5148\u770b\u4e0b\u9762\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>type\n  TTestInterface=class(TInterfacedObject)\n  public\n    destructor Destroy;override;\n  end;\nprocedure TForm1.BitBtn1Click(Sender: TObject);\nvar\n   ATest:IInterface;\nbegin\nATest:=TTestInterface.Create;\nTThread.ForceQueue(nil,procedure\n  begin\n  ShowMessage(IntToStr(ATest._AddRef));\n  ATest._Release;\n  end);\nend;\n\n{ TTestInterface }\n\ndestructor TTestInterface.Destroy;\nbegin\n  ShowMessage('Object Free');\n  inherited;\nend;<\/code><\/pre>\n\n\n\n<p>\u4e00\u822c\u6765\u8bf4\uff0c\u6211\u4eec\u8ba4\u4e3a Delphi \u81ea\u5df1\u7ba1\u7406\u63a5\u53e3\u7684\u5f15\u7528\u8ba1\u6570\uff0c\u6240\u4ee5\u4e0d\u592a\u4f1a\u6ce8\u610f\uff0c\u4f46\u662f\uff0c\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u7531\u4e8e\u8981\u4fdd\u8bc1 ATest \u5728\u533f\u540d\u51fd\u6570\u4e2d\u7684\u53ef\u7528\u6027\uff0cDelphi \u5e76\u6ca1\u6709\u5728\u51fd\u6570\u9000\u51fa\u65f6\uff0c\u51cf\u5c11 ATest \u7684\u5f15\u7528\u8ba1\u6570\uff0c\u800c\u5728\u533f\u540d\u51fd\u6570\u6267\u884c\u5b8c\u6210\u540e\uff0c\u540c\u6837\u4e5f\u5e76\u6ca1\u6709\u51cf\u5c11\u8ba1\u6570\uff0c\u8fd9\u5c31\u9020\u6210\u4e86 ATest \u5b9e\u4f8b\u7684\u5f15\u7528\u8ba1\u6570\u6ca1\u6709\u51cf\u5c11\u52300\uff0c\u7136\u540e\u5c31\u51fa\u73b0\u4e86\u5185\u5b58\u6cc4\u9732\u7684\u95ee\u9898\u3002<strong>\u8fd9\u5757\u5df2\u77e5\u572810.3.1\u4e2d\u5df2\u7ecf\u4e0d\u5b58\u5728\u8be5\u95ee\u9898\uff0c\u611f\u8c22\u83dc\u6839\u63d0\u9192<\/strong>\u3002<\/p>\n\n\n\n<p>\u81f3\u4e8e\u5f53\u524d\u7684\u7b56\u7565\uff0c\u5728\u4f60\u7684\u533f\u540d\u51fd\u6570\u8c03\u7528\u9000\u51fa\u524d\uff0c\u5c06 ATest \u7684\u5730\u5740\u8bbe\u7f6e\u4e3a nil \u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u770b\u4e0b\u9762\u7684\u793a\u4f8b\u4ee3\u7801\uff1a \u4e00\u822c\u6765\u8bf4\uff0c\u6211\u4eec\u8ba4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8,603],"tags":[769,74],"class_list":["post-5066","post","type-post","status-publish","format-standard","hentry","category-delphi","category-603","tag-769","tag-74"],"views":3252,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5066"}],"version-history":[{"count":3,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5066\/revisions"}],"predecessor-version":[{"id":5069,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5066\/revisions\/5069"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}