[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix, IMConnectors, establishConnection
From: |
Nicola Pero |
Subject: |
Re: Fix, IMConnectors, establishConnection |
Date: |
Thu, 12 Apr 2001 15:29:05 +0100 (BST) |
> It seems that there is at least one more problem of this kind with a subclass
>
> of scroll view.
I suppose that means you have a custom view ...
> I will have a closer look at this, if you don't have a suspicion already.
I have a suspicion - but I don't have the time to look into it deeply
enough to confirm it now - anyway - here is a quickly hacked patch - it
might help you.
Index: IMCustomObject.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Model/IMCustomObject.m,v
retrieving revision 1.9
diff -u -r1.9 IMCustomObject.m
--- IMCustomObject.m 2001/04/12 14:07:13 1.9
+++ IMCustomObject.m 2001/04/12 14:22:34
@@ -50,21 +50,32 @@
if (!_fileOwnerDecoded)
{
_fileOwnerDecoded = YES;
- customObject->className = [unarchiver decodeStringWithName:@"className"];
- customObject->extension = [unarchiver decodeObjectWithName:@"extension"];
- customObject->realObject = [unarchiver
decodeObjectWithName:@"realObject"];
- customObject->realObject = _nibOwner;
+ ASSIGN (customObject->className,
+ [unarchiver decodeStringWithName:@"className"]);
+
+ ASSIGN (customObject->extension,
+ [unarchiver decodeObjectWithName:@"extension"]);
+
+ ASSIGN (customObject->realObject,
+ [unarchiver decodeObjectWithName:@"realObject"]);
+
+ ASSIGN (customObject->realObject, _nibOwner);
return customObject;
}
- customObject->className = [unarchiver decodeStringWithName:@"className"];
- customObject->extension = [unarchiver decodeObjectWithName:@"extension"];
- customObject->realObject = [unarchiver decodeObjectWithName:@"realObject"];
+ ASSIGN (customObject->className,
+ [unarchiver decodeStringWithName:@"className"]);
+
+ ASSIGN (customObject->extension,
+ [unarchiver decodeObjectWithName:@"extension"]);
+
+ ASSIGN (customObject->realObject,
+ [unarchiver decodeObjectWithName:@"realObject"]);
class = NSClassFromString (customObject->className);
if (class)
{
- customObject->realObject = [[class alloc] init];
+ ASSIGN (customObject->realObject, AUTORELEASE ([[class alloc] init]));
}
else
{
@@ -75,6 +86,15 @@
return customObject;
}
+- (void)dealloc
+{
+ RELEASE (className);
+ RELEASE (extension);
+ RELEASE (realObject);
+ [super dealloc];
+}
+
+
- (id)nibInstantiate
{
return realObject;
@@ -111,25 +131,37 @@
if (!_fileOwnerDecoded)
{
_fileOwnerDecoded = YES;
- customView->className = [unarchiver decodeStringWithName: @"className"];
- customView->extension = [unarchiver decodeObjectWithName: @"extension"];
- customView->realObject = [unarchiver decodeObjectWithName:
@"realObject"];
- customView->realObject = _nibOwner;
+ ASSIGN (customView->className,
+ [unarchiver decodeStringWithName: @"className"]);
+
+ ASSIGN (customView->extension,
+ [unarchiver decodeObjectWithName: @"extension"]);
+
+ ASSIGN (customView->realObject,
+ [unarchiver decodeObjectWithName: @"realObject"]);
+
+ ASSIGN (customView->realObject, _nibOwner);
[customView setFrame: [unarchiver decodeRectWithName: @"frame"]];
return customView;
}
- customView->className = [unarchiver decodeStringWithName: @"className"];
- customView->extension = [unarchiver decodeObjectWithName: @"extension"];
- customView->realObject = [unarchiver decodeObjectWithName: @"realObject"];
+ ASSIGN (customView->className,
+ [unarchiver decodeStringWithName: @"className"]);
+
+ ASSIGN (customView->extension,
+ [unarchiver decodeObjectWithName: @"extension"]);
+
+ ASSIGN (customView->realObject,
+ [unarchiver decodeObjectWithName: @"realObject"]);
+
[customView setFrame: [unarchiver decodeRectWithName: @"frame"]];
class = NSClassFromString (customView->className);
if (class)
{
- customView->realObject = [[class alloc] initWithFrame:
- [customView frame]];
+ ASSIGN (customView->realObject,
+ AUTORELEASE ([[class alloc] initWithFrame: [customView frame]]));
}
else
{
@@ -143,6 +175,14 @@
- (id)nibInstantiate
{
return realObject;
+}
+
+- (void)dealloc
+{
+ RELEASE (className);
+ RELEASE (extension);
+ RELEASE (realObject);
+ [super dealloc];
}
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
- Fix, IMConnectors, establishConnection, Georg Fleischmann, 2001/04/11
- Re: Fix, IMConnectors, establishConnection, Nicola Pero, 2001/04/12
- Re: Fix, IMConnectors, establishConnection, Georg Fleischmann, 2001/04/12
- Re: Fix, IMConnectors, establishConnection,
Nicola Pero <=
- Re: Fix, IMConnectors, establishConnection, Georg Fleischmann, 2001/04/12
- Re: Fix, IMConnectors, establishConnection, Nicola Pero, 2001/04/17