caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Michael Wohlwend" <Michael.Wohlwend@gmx.de>
To: caml-list@inria.fr
Subject: callback question
Date: Fri, 06 Oct 2006 11:36:36 +0200	[thread overview]
Message-ID: <20061006093636.63690@gmx.net> (raw)


I'm storing an ocaml object in a c++ class (the class call methods of the
ocaml objects). To do that I register the object as described for callback
functions in the manual and use it with caml_named_value.
It works perfect so it seems to be the right way. (?)
But does the gc ever remove the object (since it is registered as a callback)?

In a class definition, is this the  correct way to get things cleaned up:

class x = object
 val obj = native_pointer
 ...
 initializer
    Gc.finalise (fun _ -> delete native_pointer) self;
end;;


 Michael

-- 
GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl


             reply	other threads:[~2006-10-06  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-06  9:36 Michael Wohlwend [this message]
2006-10-07 15:08 micha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061006093636.63690@gmx.net \
    --to=michael.wohlwend@gmx.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).