From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA21971; Sat, 3 Aug 2002 23:32:20 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA21943 for caml-list@pauillac.inria.fr; Sat, 3 Aug 2002 23:32:19 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA10269 for ; Sat, 3 Aug 2002 01:19:57 +0200 (MET DST) Received: from mail.newheights.com (mail.newheights.com [139.142.123.135]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g72NJu523612 for ; Sat, 3 Aug 2002 01:19:56 +0200 (MET DST) Received: from qbradley ([139.142.123.132]) by mail.newheights.com (8.10.2+Sun/8.10.2) with SMTP id g72NCUI29993 for ; Fri, 2 Aug 2002 16:12:30 -0700 (PDT) From: "Quetzalcoatl Bradley" To: Subject: RE: [Caml-list] OCam'OLE pre-release Date: Fri, 2 Aug 2002 16:23:10 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <000e01c23a7c$03b4ee20$551aa8c0@kyra> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk It is not safe to use any COM object, including calling Release on it, after calling CoUninitialize. Also in my experience there is much danger in relying on the order of constructor and destructor call of static variables to manage lifetime of COM objects or CoInitialize/CoUnitialize call. Move your CoUnitialize call out of a static variable and into the last statement of your program. Since the GC will not run after your CoUnitialize call, no Release calls will be made on any COM object after CoUnitialize. Alternatively, do whatever is necessary to make sure that all your COM objects are released before your program exits (perhaps by making sure there is no reachable COM object and then doing a "full major" garbage collection?) Quetzalcoatl Bradley qbradley@blackfen.com -----Original Message----- From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-list@pauillac.inria.fr]On Behalf Of kyra Sent: Friday, August 02, 2002 4:26 PM To: Nicolas Cannasse; OCaml Subject: Re: [Caml-list] OCam'OLE pre-release > Yes, i would actually ear your arguments about that point, because it does > not seems clear to me : the AddRef/Release semantic of COM is a reference > counting to enable the sharing of object and thus determine its time-life > the last Release() call will trigger effective memory release of the > object ). But ocaml variable and COM reference are merely different things. > Simply modify ocamole in order to not call "i->Release()" if CoUninitialize > had been made, or ( better ) GC'd all your COM objects before calling > ComUninit. This does not work. Even not to call CoUninitialize does not work. There is the same access violation (not segfault as i've early mentioned) error everywhere: "The object invoked has disconnected from its clients". I am in no way ocaml or COM expert, but it seems this is because ocaml not only GCs _unneeded variable_ but also Releases _still needed_ interface. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners