Page 1 of 1

[Solved+Issue] xcomponent - dispose or close

Posted: Sat Dec 29, 2012 11:53 pm
by fischel
Hi,

when I open a doc with xComponentLoader.loadComponentFromURL(filename, "_blank", 0, null) in Java, what is the right way to close it really??

I tried it with document.dispose() and I tried it with

Code: Select all

XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(XCloseable.class, document);
xClose.close(true);
but after the script is finished the memory of openoffice soffice it higher than before. When I execute the script several times, the mem increase more and more.

Can anybody give me some help?

thank you
Stephan

Code: Select all

mysystem: debian6, openoffice3.2., sunjava6
startoo with:/usr/bin/soffice -invisible -nologo -nofirststartwizard -norestore -accept="socket,host=127.0.0.1,port=8100;urp" 

Re: xcomponent - dispose or close

Posted: Sun Dec 30, 2012 3:23 pm
by F3K Total
Hello,
i did try and error with a starbasic code and found out, that's not a question of or but of and:

Code: Select all

Sub S_loadcomponent_and_close
    oDoc = StarDesktop.loadComponentFromURL("private:factory/scalc","_blank", 0, Array())
    msgbox "open" 'look at memory use
    odoc.dispose()
    oDoc.close -1
    'look at memory use again
End Sub
HTH
R

Re: xcomponent - dispose or close

Posted: Mon Dec 31, 2012 12:47 am
by fischel
Ok,

I found this helpful link, that describe how to close a document the best way with an example code:
http://wiki.openoffice.org/wiki/Documen ... _Documents

With this, my documents were closed perfect. But this doesn't solve my problem of increase memory of soffice. If I open and close documents with UNO the memory of soffice will increase every time. I think it's a OO/UNO-Bug since 7 years now !!!!

https://issues.apache.org/ooo/show_bug.cgi?id=41675

Happy Birthday Bug :)