[Solved+Issue] xcomponent - dispose or close

The Application Programming Interface and the OASIS Open Document Format

[Solved+Issue] xcomponent - dispose or close

Postby fischel » Sat Dec 29, 2012 11:53 pm

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   Expand viewCollapse view
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   Expand viewCollapse view
mysystem: debian6, openoffice3.2., sunjava6
startoo with:/usr/bin/soffice -invisible -nologo -nofirststartwizard -norestore -accept="socket,host=127.0.0.1,port=8100;urp"
Last edited by fischel on Mon Dec 31, 2012 12:48 am, edited 1 time in total.
Stephan Fischer
Berlin
fischel
 
Posts: 5
Joined: Wed Oct 17, 2012 9:40 pm

Re: xcomponent - dispose or close

Postby F3K Total » Sun Dec 30, 2012 3:23 pm

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   Expand viewCollapse view
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
    MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
    my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
F3K Total
Volunteer
 
Posts: 989
Joined: Fri Dec 16, 2011 8:20 pm

Re: xcomponent - dispose or close

Postby fischel » Mon Dec 31, 2012 12:47 am

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/Documentation/DevGuide/OfficeDev/Closing_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 :)
Stephan Fischer
Berlin
fischel
 
Posts: 5
Joined: Wed Oct 17, 2012 9:40 pm


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 2 guests