Thread: Memory Leak
View Single Post
05-29-09, 02:03 PM   #26
Vyper
A Rage Talon Dragon Guard
 
Vyper's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 317
Originally Posted by sigg View Post
You can create some Frames, but what ever happen, thoses frames will never be taken by the garbage collector. This is the reason why many developers ask you to do a reloadUI, to clear your memory of these unused objects.
Just a note: while undoubtedly a bug, and even the strict definition of a memory leak (assuming World of Warcraft doesn't maintain a reference to the frame), it's actually not a Lua leak. That frame is owned by the C++(I'm assuming it was C++ at any rate) which WoW was programmed in, with an interface provided to Lua. Because Lua doesn't own it, it's not eligible for garbage collection.
You run into similar confusing when working with JNI to pass data between Java and C. Any object that was allocated in C can't be garbage collected and must be freed, whereas you had better not try to free an object that was originally allocated in Java.

Sorry folks, I know this has gone way off topic.