Skip to content

Commit

Permalink
Leaked images (#41)
Browse files Browse the repository at this point in the history
* Leaked images

* Moved the resource release code up a bit
  • Loading branch information
romanprocopie authored and stweil committed Nov 20, 2019
1 parent 2e3fa27 commit e54c7e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OSXvnc-server/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,10 @@ void rfbGetFramebufferUpdateInRect(int x, int y, int w, int h) {
return;
}
CGContextDrawImage(context, CGRectMake(0, 0, w, h), image);
CGImageRelease(image);
imageRef = CGBitmapContextCreateImage(context);
CGContextRelease(context);

} else {
imageRef = CGDisplayCreateImageForRect(displayID, rect);
}
Expand Down Expand Up @@ -731,8 +733,10 @@ static bool rfbScreenInit(void) {
return nil;
}
CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
CGImageRelease(image);
imageRef = CGBitmapContextCreateImage(context);
CGContextRelease(context);

} else {
imageRef = CGDisplayCreateImage(displayID);
}
Expand Down

0 comments on commit e54c7e9

Please sign in to comment.