Permalink
Browse files

Bug fix - XMPPUserMemoryStorage copy method didn't properly support s…

…ubclassing.
  • Loading branch information...
robbiehanson committed Aug 31, 2011
1 parent cc68210 commit 91b8bd4b66d22dbfa0ead9ca33322f7d0bd387a4
@@ -34,7 +34,7 @@ - (void)dealloc
- (id)copyWithZone:(NSZone *)zone
{
- // We support subclassing
+ // We use [self class] to support subclassing
XMPPResourceMemoryStorage *deepCopy = (XMPPResourceMemoryStorage *)[[[self class] alloc] init];
@@ -55,7 +55,9 @@ - (void)dealloc
- (id)copyWithZone:(NSZone *)zone
{
- XMPPUserMemoryStorage *deepCopy = [[XMPPUserMemoryStorage alloc] init];
+ // We use [self class] to support subclassing
+
+ XMPPUserMemoryStorage *deepCopy = (XMPPUserMemoryStorage *)[[[self class] alloc] init];
deepCopy->jid = [jid copy];
deepCopy->itemAttributes = [itemAttributes mutableCopy];

0 comments on commit 91b8bd4

Please sign in to comment.