Hi all,

I'm using oood and experience some problem on leaving an instance. The
instance remains marked as 'in use' even when the pyUNO calling script
is ended. Trying to dispose the context ctx crashes OOo
Has someone experienced some problems with oood regarding freeing
instances ?

here is attached an example. oood is launched with one single instance.
The first pass in the loop is ok, then on the second, an error occurs

any hint or advice  are welcommed

thanks in advance

Laurent
'--------------

import uno
import time
from com.sun.star.beans import PropertyValue

# Python Imports

import os
import sys

def main():
    fini=False
    while not fini:
        context = uno.getComponentContext()
        tmp = context.ServiceManager
        while not tmp:
            time.sleep(2)
            context = uno.getComponentContext()
            tmp = context.ServiceManager
        resolver = context.ServiceManager.createInstanceWithContext(
            "com.sun.star.bridge.UnoUrlResolver", context)
        try:
ctx = resolver.resolve("uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
        except:
            print "Could not connect to running openoffice."
            sys.exit()
        if ctx :
           fini= True
        else:
            print "ctx == None"
            time.sleep(2)
desktop = ctx.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop",ctx)
    ctx.ServiceManager
    context.ServiceManager

if __name__=="__main__":
    print sys.version
    for i in range(1,5):
        print "test nb %s"%i
        main()

--
Laurent Godard <[EMAIL PROTECTED]> - Ingénierie OpenOffice.org
Indesko >> http://www.indesko.com
Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
Livre "Programmation OpenOffice.org", Eyrolles 2004


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to