Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Bug: Infinite loop in [CPView isHiddenOrHasHiddenAncestors]

#235

If you have a visible CPView and call -(BOOL)isHiddenOrHasHiddenAncestors on it, you get an infinite loop:


- (BOOL)isHiddenOrHasHiddenAncestor
{
    var view = self;
    
    while (![view isHidden])
        view = [view superview];
    
    return view != nil;
}

if all superviews respond NO to -(BOOL)isHidden, view will become nil. because nil doesn't respond true to messages, you will get an infinite loop.

the while loop should be:


while (view && ![view isHidden])

Reported by Lukas Berns · March 5th, 2009 @ 06:00 PM

State: resolved
Milestone: 0.7
Assigned to: Francisco Tolmasky Francisco Tolmasky

Activity

  1. admin (at 280north)
    admin (at 280north)
    • State changed from new to resolved
    • Tag changed from appkit, bug, cpview to @to-review, appkit, bug, cpview

    (from [ffe1f9c7a4c25cc6bc9e7253c758cd35256d50ad]) Fix for infinite loop in isHiddenOrHasHiddenAncestors.

    [#235 Bug: Infinite loop in [CPView isHiddenOrHasHiddenAncestors] state:resolved]

    Reviewed by me. http://github.com/280north/cappu...

    March 21st, 2009 @ 03:36 AM

  2. Francisco Tolmasky
    Francisco Tolmasky
    • Milestone set to 0.7
    • Assigned user set to Francisco Tolmasky

    March 21st, 2009 @ 03:39 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.