VirtualBox

Ignore:
Timestamp:
Aug 9, 2016 7:04:34 PM (8 years ago)
Author:
vboxsync
Message:

vboxshell.py: python 2.x fix (SyntaxError: can not delete variable 'ctx' referenced in nested scope) and do garbage collection before shutting down COM/XPCOM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r63223 r63231  
    3737
    3838
     39import gc
    3940import os
    4041import sys
     
    35773578
    35783579    #
    3579     # Set up the shell interpreter context and
     3580    # Set up the shell interpreter context and start working.
    35803581    #
    35813582    from vboxapi import VirtualBoxManager
     
    35993600    }
    36003601    interpret(ctx)
    3601     del ctx
    3602     ctx = None
     3602
     3603    #
     3604    # Release the interfaces references in ctx before cleaning up.
     3605    #
     3606    for sKey in list(ctx.keys()):
     3607        del ctx[sKey];
     3608    ctx = None;
     3609    gc.collect();
     3610
    36033611    oVBoxMgr.deinit()
    36043612    del oVBoxMgr
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