Quick Quartz YES/NO question

Discussion in 'iOS Programming' started by KnightWRX, Dec 15, 2010.

  1. KnightWRX macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #1
    Does the following code result in bad stuff happening ?

    Code:
    - (void)drawRect:(CGRect)rect
    {
        CGContextRef context = UIGraphicsGetCurrentContext();
        /* unimportant stuff happens here */
        CGContextRelease(context);
    }
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    I'm not sure. It looks like it might as you don't own the context you are releasing...
     
  3. KnightWRX thread starter macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #4

Share This Page