Ok it seems like using the

-(id) initWithFrame: (NSRect)frameRect
      textContainer: (NSTextContainer *)container;

initializer is the way to go. No segfault with this initializer.

However as it says in the header:
/* This variant will create the text network (NSTextStorage,
NSLayoutManager,
and a NSTextContainer). The network will be owned by the NSTextView;
releasing it will release all parts of the network. */
-(id) initWithFrame: (NSRect)frameRect;

initWithFrame should work and not cause segfault so something seems to be
wrong..

(I know I wrote alloc] init] in the previous mail but I was actually using
initWithFrame and it caused segfault for me)


--
Johannes Lundberg
BRILLIANTSERVICE CO., LTD.


On Thu, Feb 13, 2014 at 1:58 PM, Lundberg, Johannes <
johan...@brilliantservice.co.jp> wrote:

> Hi
>
> I'm using latest version of GNUstep on FreeBSD 10 64bit with ARC.
> When my NSTextView is freed I get segfault. I haven't seen this behavior
> for any other UI element.
>
> Example: Put this code in loadview
>     NSTextView *tv = [[NSTextView alloc] init];
>
> and it segfaults when object is released.
>
> I haven't really done any debugging yet except finding where this happens.
> Thought I send this mail first before I dive into the gui source code.
>
> #0  0x0000000802d9aa74 in objc_msgSend_fpret () from
> /usr/local/lib/libobjc.so.4.6
> #1  0x0000000800db5379 in -[NSView dealloc] (self=0x81aee9b90, _cmd=<value
> optimized out>) at NSView.m:651
> #2  0x0000000800d9951a in -[NSTextView dealloc] (self=<value optimized
> out>, _cmd=<value optimized out>) at NSTextView.m:1141
> #3  0x0000000800d9121b in -[NSTextContainer dealloc] (self=0x81ddd1f30,
> _cmd=0x8011e3b60) at NSTextContainer.m:134
> #4  0x00000008014fe67a in -[GSArray dealloc] (self=0x81e411290,
> _cmd=<value optimized out>) at GSArray.m:137
> #5  0x0000000802d9b5c9 in objc_autoreleasePoolPop () from
> /usr/local/lib/libobjc.so.4.6
> #6  0x000000080154a400 in -[NSAutoreleasePool dealloc] (self=0x81af462f0,
> _cmd=<value optimized out>) at NSAutoreleasePool.m:729
> #7  0x0000000800c975d4 in -[NSApplication run] (self=0x81aca9490,
> _cmd=0x8011e3b60) at NSApplication.m:1543
> #8  0x0000000000425965 in main (argc=2, argv=0x7fffffffc798) at main.m:20
>
>
> Best regards
> --
> Johannes Lundberg
> BRILLIANTSERVICE CO., LTD.
>

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。
もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、
複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message.
_______________________________________________
Bug-gnustep mailing list
Bug-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to