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 MAA27736; Fri, 2 Aug 2002 12:13:24 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA27715 for ; Fri, 2 Aug 2002 12:13:23 +0200 (MET DST) Received: from mel-rto6.wanadoo.fr (smtp-out-6.wanadoo.fr [193.252.19.25]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g72ADNf15396 for ; Fri, 2 Aug 2002 12:13:23 +0200 (MET DST) Received: from mel-rta7.wanadoo.fr (193.252.19.61) by mel-rto6.wanadoo.fr (6.5.007) id 3D49FD97000202AC; Fri, 2 Aug 2002 12:13:21 +0200 Received: from warp (80.13.116.114) by mel-rta7.wanadoo.fr (6.5.007) id 3D49FF140001ED9A; Fri, 2 Aug 2002 12:13:21 +0200 Message-ID: <001101c23a0d$2f184220$0700a8c0@warp> From: "Nicolas Cannasse" To: "kyra" , "OCaml" References: <000901c237fe$04a92510$0700a8c0@warp> <001901c239b4$be8ccbf0$551aa8c0@kyra> Subject: Re: [Caml-list] OCam'OLE pre-release Date: Fri, 2 Aug 2002 12:13:01 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > But I must point out typical error (I saw exactly the same error in Haskell > HDirect/COM library): ocaml finalization and com release are _essentially > different_ entities! Sorry for not being sufficiently verbose - i have not > enough time right now. If You doubt this is an issue - I will definitely > clarify my point. 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 ). For OLE , Release() doesn't not close the Application if it has been put Visible to the user, but CoUninitiliaze will break the DDE and close it. That's why i added the primitive "do_not_close" which prevent CoUninitialize from being called, to enable Applications to remains open even if the ocaml exit. > Now only a few words: I've built native olegen version > (having replaced CoInitialize/CoUninitialize call in DllMain with a call in > a static dummy class instance constructor/destructor), and discovered this > olegen causes segmentaion fault! It turned out to be sufficient simply to > comment out "i->Release();" in "com_finalize" to make it work. That behavior should be explained by the following : Release() is called by the GC, and OCamole perform a full_major cycle on "at_exit" of OCaml. But if you call CoUnitialize perform having all the COM objects being properly Released, it can freeze, or simply go on... but then a call to Release() will cause a seg_fault. 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. Nicolas Cannasse ------------------- 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