Hi Laurent,

As I understand, in your case the event on a document window activates the macro and the macro closes the document. Please correct me if I have misunderstood the scenario.

The problem looks to be that the vcl-window that calls the listener is destroyed, thus a call on dead object lies on the stack. A workaround could be to close the current document asynchronously. You could use the com.sun.star.awt.AsyncCallback service. Please see the following link for details
http://wiki.services.openoffice.org/wiki/Framework/Article/Asynchronous_Callback_Service

I do not know any issue related to the scenario.

Best regards,
Mikhail.

On 12/18/09 12:11, Laurent Godard wrote:
Hi all

Using OOoBasic, I implement some listerners on calc documents

com.sun.star.awt.XMouseClickHandler
com.sun.star.awt.XKeyHandler
com.sun.star.frame.XFrameActionListener
com.sun.star.sheet.XActivationEventListener

it globally works as expected but on some cases i experience OOo crashes

inside the XMouseClickHandler, i need to close the current document and open an other calc document I shutdown properly the listeners using the remove* methods before closing the current document

it closes, the other opens and document load events are triggered. In these event i launch the listener for this document. all is fine, the new doc is available

Then the crash occurs.

I traced using debugging and the problem seems to be the basic call stack
After the load of the new document, all the calling subs end properly but, after exiting the last one, onMouseEvent_MouseReleased, OOo Crashes

I suspect a reference problem to the original document but can not find a way to solve this. I'm stuck

Is it a known bug ? (i call it a bug as OOo should not crash, even if the macro do illegal things) Is there a way to launch a new document and close the current one on reacting to a listener

feel free to ask for more details

Thanks in advance

Laurent



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org
For additional commands, e-mail: dev-h...@framework.openoffice.org



--
Sun Microsystems GmbH                Mikhail Voytenko
Nagelsweg 55                         Software Engineer
20097 Hamburg                        Phone: (+49 40)23646 500
Germany                              Fax:   (+49 40)23646 550
http://www.sun.de                    mailto:mikhail.voyte...@sun.com

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org
For additional commands, e-mail: dev-h...@framework.openoffice.org

Reply via email to