Skip to content

snippet107.d #6

@WendleC

Description

@WendleC

Line 254 in file dwt/widgets/Button.d

NSAttributedString createString() {
NSAttributedString attribStr = createString(text, null, foreground, style, true, true);
attribStr.autorelease();
return attribStr;
}

attribStr.autorelease(); causes the crash. If commented out, snippet won't crash. Problem (probably): attribStr is freed before it is returned. In Objective-C this is normally avoided by

return [attribStr autorelease]; // in the return statement

Note: Check how many other snippets depend on Buttons!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions