gg.Irrlicht - drop() on null

BlitzMax Forums/BlitzMax Programming/gg.Irrlicht - drop() on null

gman(Posted 2005) [#1]
in the next mod release ive decided to remove the automatic call to drop() when an instance of a subclass of T_irrIUnknown is released. the main reason for this is i have begun to see some things people are writing and the #1 issue i see is that drop() is being called manually. this will lead to reference counting issues and is different from how all the C++ based examples are written. i will apply this change to the samples as well.

what does this mean to you? anywhere you use a method (not function) that starts with "create" to obtain an instance of a type, you must call the drop() method when you are done with it. i dont mean the create functions used for each type, im referring to the methods in the Irrlicht API manual that start with create, so if in doubt, check the manual. a good rule of thumb is if you are calling something that starts with "create" using the actual type instead of a variable, you wont need to call drop().


gman(Posted 2005) [#2]
UPDATE: thought of a way to get the best of both worlds. in the next mod release you will be able to do it either way.


DStastny(Posted 2005) [#3]
Sounds good, personally I like the auto drop, however I can understand some people if porting straight C++ code might find it easier the other way.

Doug Stastny