|
From: | Doug Simons |
Subject: | TextStorage freed when its LayoutManager is removed |
Date: | Tue, 23 Mar 2010 16:15:35 -0600 |
Okay, here's another problem that's apparently been exposed by the recent changes to retains when loading a nib. It appears there is a problem in the way objects retain/release each other in the text system. We have an NSSecureTextField in a panel loaded from a nib file. When the panel is displayed, it tries to setup the secure text field which replaces the layout manager with a secure layout manager. But when replaceLayoutManager: calls [textStorage removeLayoutManager: _layoutManager] this results in the textStorage object itself being freed, and it crashes on the next line. I tried to figure out what was going on, but there are a lot of subtle interconnections in the text system, so I'm not sure exactly what isn't being retained that needs to be (or is being released that shouldn't be!). Here's what the crash looks like: Program received signal SIGSEGV, Segmentation fault. 0x67848ae6 in objc_msg_lookup () from c:\GNUstep\GNUstep\System\Tools\objc-1.dll (gdb) bt #0 0x67848ae6 in objc_msg_lookup () from c:\GNUstep\GNUstep\System\Tools\objc-1.dll #1 0x63c24e04 in -[NSTextContainer replaceLayoutManager:] (self=0x9de34b0, _cmd=0x63d65b38, aLayoutManager=0x144b890) at NSTextContainer.m:171 #2 0x63bee87e in -[NSSecureTextView initWithFrame:textContainer:] (self=0x1401ea0, _cmd=0x63db4870, frameRect={origin = {x = 0, y = 0}, size = {width = 0, height = 0}}, aTextContainer=0x9de34b0) at NSSecureTextField.m:305 #3 0x63c9e5f1 in -[NSTextView initWithFrame:] (self=0x1401ea0, _cmd=0x63d8b058, frameRect= {origin = {x = 0, y = 0}, size = {width = 0, height = 0}}) at NSTextView.m:744 #4 0x63c3aa9c in -[NSView init] (self=0x1401ea0, _cmd=0x63d65aa8) at NSView.m:566 #5 0x63bee378 in -[NSSecureTextFieldCell setUpFieldEditorAttributes:] (self=0x15a35a0, _cmd=0x63d7df98, textObject=0x1290ee0) at NSSecureTextField.m:209 #6 0x63c2649e in -[NSTextField selectText:] (self=0x994d9d0, _cmd=0x63d7e070, sender=0x994d9d0) at NSTextField.m:181 #7 0x63c26e17 in -[NSTextField becomeFirstResponder] (self=0x994d9d0, _cmd=0x63d91b70) at NSTextField.m:431 #8 0x63c53285 in -[NSWindow makeFirstResponder:] (self=0x16594c0, _cmd=0x585240, aResponder=0x994d9d0) at NSWindow.m:3176 On Mar 22, 2010, at 3:44 PM, Doug Simons wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |