diff --git a/ChangeLog b/ChangeLog index 11973e025..760fbd2d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-02-15 18:11 Alexander Malmberg + + * Source/NSParagraphStyle.m ([NSMutableParagraphStyle + -copyWithZone:]): Add calls to GSDebugAllocationAdd/ + GSDebugAllocationRemove when swizzling the class to keep the + allocation counts valid. + 2003-02-15 18:04 Alexander Malmberg * Source/NSSpellChecker.m (-_launchSpellCheckerForLanguage:): Don't diff --git a/Source/NSParagraphStyle.m b/Source/NSParagraphStyle.m index d45a0e998..b8f0a6212 100644 --- a/Source/NSParagraphStyle.m +++ b/Source/NSParagraphStyle.m @@ -26,6 +26,10 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* To keep the allocation counts valid when swizzling the class in +[NSMutableParagraphStyle -copyWithZone:]. */ +#include + #include #include @@ -479,7 +483,9 @@ static NSParagraphStyle *defaultStyle = nil; NSMutableParagraphStyle *c; c = (NSMutableParagraphStyle*)NSCopyObject (self, 0, aZone); + GSDebugAllocationRemove(c->isa, c); c->isa = [NSParagraphStyle class]; + GSDebugAllocationAdd(c->isa, c); c->_tabStops = [_tabStops mutableCopyWithZone: aZone]; return c; }