title: How to deallocate an acces type variable before returning value at end of function?
body: <p>In a function it would be convenient to use a <code>sting</code> <code>access</code> <code>type</code>, for example through <code>textio.line</code>, and the final value is the output from the function.  Simple example code that shows the issue, but not the motivation for using an <code>access</code> <code>type</code>:</p>
  
  <pre><code>function fun return string is
    variable line_v : line;
  begin
    line_v := new string'("Hello VHDL world");
    return line_v.all;  -- line_v is missing deallocate(line_v)
  end function;
  </code></pre>
  
  <p>But this code is missing a <code>deallocate(line_v)</code> in order to avoid a memory leak when the allocated memory for the strings is not released.</p>
  
  <p>How to make a <code>deallocate(line_v)</code>, when returning the value from <code>line_v</code>?</p>