bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #25266] NSNibOutletConnector not freed after loading a NIB file


From: Fred Kiefer
Subject: [bug #25266] NSNibOutletConnector not freed after loading a NIB file
Date: Fri, 09 Jan 2009 18:40:11 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.9 (like Gecko) SUSE

Update of bug #25266 (project gnustep):

             Assigned to:                    None => gcasa                  

    _______________________________________________________

Follow-up Comment #1:

Finding the root cause was easy, the following line in GSNibLoading.m was
leaking the copied array

ASSIGN(_connections,  [[coder decodeObjectForKey: @"NSConnections"]
mutableCopy]); 

replacing it with
_connections = [[coder decodeObjectForKey: @"NSConnections"] mutableCopy];

solves this. But now there are problems with the freed up objects. One of
these problems I could trace down to this method:

@implementation NSNibConnector (NibCompatibility)
- (void) instantiateWithInstantiator: (id<GSInstantiator>)instantiator
{
  _src = [instantiator instantiateObject: _src];
  _dst = [instantiator instantiateObject: _dst];
}
@end

When the instantiated object is different from the original one, then one is
leaked whereas the other has no retain. Replacing this with the following
solves the issue:

  [self setSource: [instantiator instantiateObject: _src]];
  [self setDestination: [instantiator instantiateObject: _dst]];

Still there are many more places where now already freed objects get
released. All of this was hidden by the original memory leak.

At this point I gave up, my impression is that currently the code in
GSNibLoading needs a full rework. And with the current lack of documentation
in that class it would take me to long to understand the different concepts
used here.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?25266>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]