Hi,
Nearly all the classes inherited from 'AbsFunctionComponent' have the following comment.
// BUG - These can not currenrtly be deleted.
// The code is not consistant here. In places a new vector is returned
// in others a reference to a vector that is managed by other code is returned.
This memory leak can be solved using the following change in file ObjectComponent.cpp.
The changed function is as follows,
After making this change if we un-comment the code below,
// BUG - These can not currenrtly be deleted.
// The code is not consistant here. In places a new vector is returned
// in others a reference to a vector that is managed by other code is returned.
// delete tmp;
// tmp = NULL;
The interpreter works, and the result is also not changed, at least for the definition file that i had given.
But is the above change valid, or will it cause some bugs or crashes in the interpreter.
Please reply.
Thanks & Regards,
Suraj K.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Nearly all the classes inherited from 'AbsFunctionComponent' have the following comment.
// BUG - These can not currenrtly be deleted.
// The code is not consistant here. In places a new vector is returned
// in others a reference to a vector that is managed by other code is returned.
This memory leak can be solved using the following change in file ObjectComponent.cpp.
The changed function is as follows,
After making this change if we un-comment the code below,
// BUG - These can not currenrtly be deleted.
// The code is not consistant here. In places a new vector is returned
// in others a reference to a vector that is managed by other code is returned.
// delete tmp;
// tmp = NULL;
The interpreter works, and the result is also not changed, at least for the definition file that i had given.
But is the above change valid, or will it cause some bugs or crashes in the interpreter.
Please reply.
Thanks & Regards,
Suraj K.
I've added issue #265 for this, and I will look into it more thoroughly when I can.
Thanks for the contribution,
Andy
Thankyou.