Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / The importence of code cleanup in MB??
  RSS 2.0 ATOM  

The importence of code cleanup in MB??
Rate this thread
 
49866
 
Permlink of this thread  
avatar
  • Nenox
  • Posted: 25 November 2010 10:19 PM
  • Total Posts: 58
  • Joined: 30 August 2006 09:08 AM

Hi,

I have seen a lot of MB scripts include a clean up line - like this one:
del (FBSystem, FBComponent, lList, lScene, lGroups)

I know that Python has automatic garbage collection and would assume that everything that should only have one instance is setup as a singleton.. But I don’t know much about C++ or the Boost wrapper.

Can someone elaborate on the importance of explicit cleanup?



Replies: 0
avatar
  • qhliao
  • Posted: 26 November 2010 04:22 AM

my felling is that if without explicit cleanup, the internal (MB core) object refereed by this python object could be destroyed later, while this python object (and thus ORSDK object) still exist, but refer to an invalid internal object. Anyway, it’s good habit to cleanup the stuff you created to avoid surprise.




Replies: 0