ViewportSelect.PickObject() memory leak ?



  • On 16/06/2013 at 02:05, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   r14 
    Platform:      
    Language(s) :     C++  ;   PYTHON  ;

    ---------
    Hi,

    I am not absolutely sure that this problem is caused by the SDK but i have been running 
    into a strange behaviour regarding ViewportSelect.PickObject(). I have a toolset of python 
    ToolData tools which were single object selection only until now. I wanted to extended them 
    with the capability to run with multiple object selections. So i added the PickObject() method 
    to my tools BaseClass.

    But when I run any of my tools now my ram is flooded extremely fast. The speed depends on 
    the scene size and the size of the multiple object selection. It looks like the ViewportSelect is 
    allocating some memory for the object list passed to PickObject() and doesn't free that memory. 
    I have tried multiple variations of my BaseClass, in which the ViewportSelect is actually a class 
    member to throttle unnecessary re initialization of the vpselect object. Here is a version stripped
    down as much as possible where the vpselect is not a class member to avoid any problems 
    caused by that.

    Am I doing something fundamentally wrong, or is this just a bug ? Thanks for reading,

    Happy rendering,
    Ferdinand

    Hm,

    it seems that I have solved the problem for now by not making the viewportselect object a 
    class member, but that should be mentioned in the docs, as the only thing that keeps
    vpselect from freezing the computer is the python garbage collector.

    happy rendering,
    ferdinand


Log in to reply