Changeset 61186 in vbox for trunk/src/VBox/Main/webservice
- Timestamp:
- May 25, 2016 7:52:06 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/websrv-python.xsl
r59798 r61186 175 175 self.handle = handle 176 176 self.isarray = isarray 177 <!-- 178 This doesn't work now 179 mgr.register(handle) 177 if self.isarray: 178 for strHnd in handle: 179 mgr.register(strHnd) 180 else: 181 mgr.register(self.handle) 180 182 181 183 def __del__(self): 182 mgr.unregister(self.handle)183 --> 184 self.releaseRemote() 185 184 186 def releaseRemote(self): 185 187 try: 186 req=IManagedObjectRef_releaseRequestMsg() 187 req._this=handle 188 self.mgr.getPort().IManagedObjectRef_release(req) 188 if self.handle is not None: 189 if self.isarray: 190 for strHnd in self.handle: 191 self.mgr.unregister(strHnd) 192 else: 193 self.mgr.unregister(self.handle) 194 self.handle = None; 189 195 except: 190 196 pass … … 211 217 212 218 def __str__(self): 213 return self.handle 219 if self.isarray: 220 return str(self.handle) 221 else: 222 return self.handle 214 223 215 224 def isValid(self): … … 495 504 from VirtualBox_client import * 496 505 497 class ManagedManager:498 def __init__(self ):506 class ObjectRefManager: 507 def __init__(self, sessionmgr): 499 508 self.map = {} 500 501 def register(self,handle): 509 self.sessionmgr = sessionmgr 510 511 def register(self, handle): 502 512 if handle == None: 503 513 return … … 506 516 self.map[handle]=c 507 517 508 def unregister(self, handle):518 def unregister(self, handle): 509 519 if handle == None: 510 520 return … … 517 527 req=IManagedObjectRef_releaseRequestMsg() 518 528 req._this=handle 519 self. mgr.getPort().IManagedObjectRef_release(req)529 self.sessionmgr.getPort().IManagedObjectRef_release(req) 520 530 except: 521 531 pass 522 self.map[handle] = -1532 del self.map[handle] 523 533 else: 524 534 self.map[handle] = c … … 873 883 import base64 874 884 875 class IWebsessionManager2(IWebsessionManager ):885 class IWebsessionManager2(IWebsessionManager, ObjectRefManager): 876 886 def __init__(self, url): 877 887 self.url = url … … 879 889 self.handle = None 880 890 self.mgr = self 891 ObjectRefManager.__init__(self, self.mgr) 881 892 882 893 def getPort(self):
Note:
See TracChangeset
for help on using the changeset viewer.