<p>Looking at the <a href="https://wiki.gnome.org/action/show/Projects/GObjectIntrospection/Annotations?action=show&redirect=GObjectIntrospection%2FAnnotations">GI docs</a>, it appears both the <code>type</code> and <code>foreign</code> annotations are designed for this exact use-case, without causing any weird ownership issues in garbage collected languages like the GBoxed hack will do.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/geany/geany/pull/1038#issuecomment-220480921">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ01hU-lnR0cUbXvlZwH2Q55WVQ3Aks5qDPdcgaJpZM4Ifw_7.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/1038#issuecomment-220480921"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>