VirtualBox

Changeset 19902 in vbox for trunk/src


Ignore:
Timestamp:
May 22, 2009 9:19:33 AM (16 years ago)
Author:
vboxsync
Message:

Python: per-thread COM initialization in glue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/vboxapi.py

    r19900 r19902  
    128128        return obj.__getattr__(field)
    129129
     130    def initPerThread(self):
     131        import pythoncom
     132        # or with pythoncom.COINIT_APARTMENTTHREADED?
     133        pythoncom.CoInitializeEx()
     134
     135    def deinitPerThread(self):
     136        import pythoncom
     137        pythoncom.CoUninitialize()
     138
    130139
    131140class PlatformXPCOM:
     
    156165    def getArray(self, obj, field):
    157166        return obj.__getattr__('get'+field.capitalize())()
     167
     168    def initPerThread(self):
     169        pass
     170
     171    def deinitPerThread(self):
     172        pass
    158173
    159174class PlatformWEBSERVICE:
     
    189204    def getArray(self, obj, field):
    190205        return obj.__getattr__(field)
    191            
     206   
     207    def initPerThread(self):
     208        pass
     209
     210    def deinitPerThread(self):
     211        pass
    192212
    193213class SessionManager:
     
    226246        if hasattr(self, "vbox"):
    227247            del self.vbox
     248
     249    def initPerThread(self):
     250        self.platform.initPerThread()
     251
     252    def deinitPerThread(self):
     253        self.platform.deinitPerThread()
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette