Re: "Live" image preview, huge memory usage...
Re: "Live" image preview, huge memory usage...
- Subject: Re: "Live" image preview, huge memory usage...
- From: Jean-Nicolas Jolivet <email@hidden>
- Date: Thu, 04 Dec 2008 03:49:34 -0500
One last thing (I know, I'm annoying!..) I'm guessing its impossible
to have this sweet workaround working in a thread right?
Thing is, I have a lot of images to generate.. so I do it in a
separate thread... your trick works well (borrowing an onscreen
graphic context), but as soon as I do it in a thread, the leak re-
appears...
On 4-Dec-08, at 3:26 AM, Jean-Nicolas Jolivet wrote:
Just wanted to say that I got it to work finally! :)
basically I thought the last part of your code, where you render the
CGImage in the current context was a necessary part of the trick, I
realized that it wasn't hehe...
No noticeable leaks now! Thanks a lot for this trick!
On 3-Dec-08, at 8:27 PM, Rob Keniger wrote:
On 03/12/2008, at 6:22 PM, Jean-Nicolas Jolivet wrote:
Quick question (2 actually), right now Im drawing my CIImage in a
custom view... would drawing the CIImage in my view's drawRect
method achieve the same (leak-free) result as your piece of
code??? i.e. something simple like:
<snip>
As far as I know, as long as you are drawing the CIImage to an on-
screen context there will be no memory leak, so this should be fine
if the view is in an on-screen window.
Second question; my app does batch image processing so eventually
I will have to draw those CIImage offscreen.. (only for the Color
Control Filter actually)... I assume I have to live with the leak??
No, just use the code I posted which will prevent the leak from
occurring when drawing offscreen, you just have to get an existing
on-screen context to draw into. The drawing itself happens
offscreen, you are just "borrowing" the on-screen context. You
could get the context from anywhere as long as it's a valid on-
screen context - in the example I posted I used the main window's
context ([[NSApp mainWindow] graphicsContext]) but this is not the
only way to do it.
--
Rob Keniger
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >"Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: glenn andreas <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: douglas welton <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Rob Keniger <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Rob Keniger <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Rob Keniger <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |