I'm curious, when there is code like:<p><pre><code> case let matches: [][]regex::capture =>
defer regex::free_matches(matches);
</code></pre>
is there a gap between those two statements where memory for matches has been allocated in regex but won't be freed because the defer hasn't happened?<p>For example, in Python I'd write:<p><pre><code> fd = None
try:
fd = os.open(...)
(do stuff with fd)
except Exception, err:
(report err)
finally:
if fd is not None:
os.close(fd)
</code></pre>
so that there is no gap. It might be tempting to write:<p><pre><code> try:
fd = os.open(...)
(do stuff with fd)
except Exception, err:
(report err)
finally:
os.close(fd)
</code></pre>
That works if (do stuff with fd) fails but blows up with fd uninitialized in os.close if os.open fails.