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/




_______________________________________________
Bug-gnustep mailing list
Bug-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to