Hi, Ted. > On Mar 1, 2008, at 12:31 PM, Sam Bishop wrote: >> What got me looking at this was valgrind complaining about target >> information being leaked. I've looked at this a little closer, and >> it appears that the leak is in the library code. I should be able >> to fix that.
Hmm... I can see what the problem is, but I'm not sure how it should be fixed. As stated in its header file, the TargetInfo class does not take ownership of the TargetInfoImpl objects it uses. On the other hand, the primary TargetInfoImpl object can only be set indirectly, by calling the CreateTargetInfo() function, but there's no way to get a pointer to the object the function creates. The solution I'm leaning toward is making the TargetInfo::AddSecondaryTarget() method private, since it isn't used anywhere else, and have the TargetInfo class cleanup any TargetInfoImpl objects it creates and uses. A patch is attached, if you think that's the way to go. Thanks, Sam
bin9MO8ciKGLx.bin
Description: Binary data
_______________________________________________ cfe-dev mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
