caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: micha <micha-1@fantasymail.de>
To: caml-list@inria.fr
Subject: callback question
Date: Sat, 7 Oct 2006 17:08:48 +0200	[thread overview]
Message-ID: <20061007170848.2cc160a2@localhost> (raw)

I'm storing an ocaml object in a c++ class (the class calls methods of
the ocaml class). 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


             reply	other threads:[~2006-10-07 15:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-07 15:08 micha [this message]
2006-10-07 15:16 ` [Caml-list] " Richard Jones
2006-10-07 17:51   ` micha
  -- strict thread matches above, loose matches on Subject: below --
2006-10-06  9:36 Michael Wohlwend

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=20061007170848.2cc160a2@localhost \
    --to=micha-1@fantasymail.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).