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 MAA28849; Sun, 4 Aug 2002 12:58:06 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 MAA28877 for ; Sun, 4 Aug 2002 12:58:05 +0200 (MET DST) Received: from mx9.mail.ru (mx9.mail.ru [194.67.57.19]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g74Aw4521804 for ; Sun, 4 Aug 2002 12:58:05 +0200 (MET DST) Received: from [213.171.63.98] (helo=kyra) by mx9.mail.ru with smtp (Exim SMTP.9) id 17bJ5H-000HZH-00 for caml-list@inria.fr; Sun, 04 Aug 2002 14:58:03 +0400 Message-ID: <001701c23bae$8a200de0$551aa8c0@kyra> From: "kyra" To: References: Subject: Re: [Caml-list] OCam'OLE pre-release Date: Sun, 4 Aug 2002 15:00:33 +0300 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 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "Quetzalcoatl Bradley" > > 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?) Errors mentioned have HOTHING with improper CoUnitialize call. I' have already written they persist even if I _remove_ CoUnitialize totally. Errors are because of COM interface is called _after_ being entirely Released. Moreover, not only native olegen but also native excel1 works just fine with my modifications. My static object destructor call of CoUninitialize does not check 'uninit' flag and so 'do_not_close()' has no impact on CoUninitialize call, but I see no any freezings or something like this. I am too bad com or ocaml expert, but i'd prefer to unbind Release from com_finalize, and to have an option to call Release explicitly. ------------------- 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