简体   繁体   中英

Swig/Python detected a memory leak

I try to learn Maya (3d Software) API with Python, but I encounter some problems..

class Foo (node):
    def __init__ (self, arg):
        if isinstance (arg, str):
            fGlobal = OpenMaya.MGlobal()
            fGlobal.selectByName (arg , OpenMaya.MGlobal.kReplaceList)
            selected = OpenMaya.MSelectionList()
            fGlobal.getActiveSelectionList(selected);
            obj = OpenMaya.MObject()
            selected.getDependNode(0,obj)
        else :
            obj = arg

Everytime i use this class, Maya returns me a warning message.

swig/python detected a memory leak of type 'MGlobal *', no destructor found.

Does someone know what does it mean ?

我找到了解决方案,看来MGobal类是静态的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM