https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-12-09T21:11:47ZRuby Issue Tracking SystemRuby master - Feature #7525: How to avoid memory leak when something gets wrong and throw exception when using win32api?https://bugs.ruby-lang.org/issues/7525?journal_id=345542012-12-09T21:11:47Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>usa (Usaku NAKAMURA)</i></li><li><strong>Target version</strong> set to <i>2.0.0</i></li></ul><p>Is this really a feature request? Or bug report?</p>
<p>Assigning to usa.<br>
Usa-san, if this is a feature, please set the target to next minor.<br>
If this is a bug report, please consider how to fix.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p> Ruby master - Feature #7525: How to avoid memory leak when something gets wrong and throw exception when using win32api?https://bugs.ruby-lang.org/issues/7525?journal_id=349392012-12-21T21:56:18Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Rejected</i></li></ul><a name="This-is-not-a-feature-request-nor-a-bug-report-Only-quetion"></a>
<h1 >This is not a feature request nor a bug report. Only quetion.<a href="#This-is-not-a-feature-request-nor-a-bug-report-Only-quetion" class="wiki-anchor">¶</a></h1>
<p>Generically, you can use begin-ensure-end syntax to release resources.<br>
For example:<br>
begin<br>
foo = get_some_resource<br>
do_something_and_raises_exception<br>
ensure<br>
release_the_resource(foo) if foo<br>
end</p> Ruby master - Feature #7525: How to avoid memory leak when something gets wrong and throw exception when using win32api?https://bugs.ruby-lang.org/issues/7525?journal_id=357112013-01-30T09:53:00Zmghomn (Justin Peal)yujianbin@huawei.com
<ul></ul><p>Thank you for the resource release schema!</p>