<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <dl style="line-height: 1.5; margin-left: 2em">
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
      <dd style="margin-left: 8.5em">Kouhei Sutou &lt;kou****@clear*****&gt;</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
      <dd style="margin-left: 8.5em">2013-06-09 19:44:04 +0900 (Sun, 09 Jun 2013)</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
      <dd style="margin-left: 8.5em"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465">1bf521642fd775e4562b62b51f363e4097363465</a></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Message</dt>
      <dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">plugin: don't increment reference count for temporary use

Plugin registration isn't multi-thread safe. Should we add locks?</pre></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
      <dd style="margin-left: 8.5em">
        <ul>
          <li><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#diff-0">lib/plugin.c</a></li>
        </ul>
      </dd>
    </dl>

    <div class="diff-section" style="clear: both">
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: lib/plugin.c (+15 -4)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L160">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L161">161</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L162">162</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L163">163</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L164">164</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L165">165</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L166">166</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L167">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L168">168</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L169">169</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L170">170</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L171">171</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L172">172</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L173">173</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L174">174</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L175">175</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L296">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L297">297</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L298">298</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L299">299</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L300">300</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L301">301</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L302">302</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L303">303</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L304">304</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L305">305</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L306">306</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L307">307</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0L308">308</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R160">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R161">161</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R162">162</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R163">163</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R164">164</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R165">165</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R166">166</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R167">167</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R168">168</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R169">169</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R170">170</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R171">171</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R172">172</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R173">173</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R174">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R175">175</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R176">176</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R177">177</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R178">178</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R179">179</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R180">180</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R181">181</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R302">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R303">303</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R304">304</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R305">305</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R306">306</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R307">307</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R308">308</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R309">309</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R310">310</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R311">311</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R312">312</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R313">313</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R314">314</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R315">315</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R316">316</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R317">317</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R318">318</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/1bf521642fd775e4562b62b51f363e4097363465#L0R319">319</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -161,6 +161,13 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">grn_plugin_initialize(grn_ctx *ctx, grn_plugin *plugin,</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">   return ctx-&gt;rc;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> }</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+static grn_id</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+grn_plugin_find(grn_ctx *ctx, const char *filename, grn_plugin **plugin)</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+{</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+  return grn_hash_get(ctx, grn_plugins, filename, PATHLEN(filename),</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+                      (void **)&amp;plugin);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+}</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> grn_id</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> grn_plugin_open(grn_ctx *ctx, const char *filename)</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> {</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -168,8 +175,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">grn_plugin_open(grn_ctx *ctx, const char *filename)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">   grn_dl dl;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   grn_plugin **plugin;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-  if ((id = grn_hash_get(ctx, grn_plugins, filename, PATHLEN(filename),</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-                         (void **)&amp;plugin))) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+  if ((id = grn_plugin_find(ctx, filename, plugin))) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     if (plugin &amp;&amp; *plugin) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       (*plugin)-&gt;refcount++;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     }</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -297,12 +303,17 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">grn_plugin_register_by_path(grn_ctx *ctx, const char *path)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">   GRN_API_ENTER;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   if (GRN_DB_P(db)) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     grn_id id;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-    id = grn_plugin_open(ctx, path);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    grn_bool opened = GRN_FALSE;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    id = grn_plugin_find(ctx, path, NULL);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    if (id == GRN_ID_NIL) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+      id = grn_plugin_open(ctx, path);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+      opened = GRN_TRUE;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     if (id) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       ctx-&gt;impl-&gt;plugin_path = path;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       ctx-&gt;rc = grn_plugin_call_register(ctx, id);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       ctx-&gt;impl-&gt;plugin_path = NULL;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-      if (ctx-&gt;rc) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+      if (ctx-&gt;rc &amp;&amp; opened) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         grn_plugin_close(ctx, id);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     }</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>