[libreoffice-dev] -calling a service function from BASIC macro

Stephan Bergmann sbergman at redhat.com
Tue Feb 12 01:43:37 PST 2013


On 02/11/2013 06:29 PM, Rai, Neeraj wrote:
> The function is getting called now, however, I get a crash a bit later when sheet_ is being accessed.
> I also added a button and attached the macro to it for conveninece of calling.
> There seems to be some difference between the direct call and call via button/macro.
>
> You need to issue "make run" to test the crash. It invokes the uno exe with calc.uno.so
> The code is triggered when calc.uno.so connects and tries to access the sheet.
> I added print statements in the function insertIntoCellS to highlight the crash.
> It prints creating the header but never gets inside the function insertIntoCellS

Your runThread holds a reference to the CalcAddinSpread object by plain 
pointer, and the refcounted object (only to be referenced via 
com::sun::star::uno::Reference etc.) has already been destroyed when you 
still access it via that now-dangling pointer.  See salhelper/thread.hxx 
and its uses in the codebase for patterns how to use threads in LO.

Stephan


More information about the LibreOffice mailing list