Hey again,<br><br>I'm trying to implement a load / unload module functionallity. When I delete the module in the __main__ dict the module's reference count is still > 1. I've been trying to find if I reference it anywhere else in my code but I can't find anything! When I did a check in vc++ debugger found something. When I run this code:<br>
<br>object obj = import(name.c_str()); <br><br><i>obj</i>'s <i>ob_refcnt</i> member is 2 when I check in the vc++ debugger. Shouldn't it be 1?<br><br>After that line, I put it in the __main__ dict like:<br>
<br>mMainNamespace[ name.c_str() ] = obj;<br><br>The reference count shows 4, as expected.<br><br>When I'm entering my unload() function when I want to remove the module I do like:<br>void unload()<br>{<br> object t = mMainNamespace[ name.c_str() ];<br>
// reference count in t is now 4 ?<br><br> mMainNamespace[ name.c_str() ].del(); // I delete but it's not unloaded properly because it's still referenced somewhere ..<br>}<br><br>What does import() do? It must save some reference somewhere?<br>
<br>