Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-09-2011, 04:11 AM   #25 (permalink)
spymaster
Registered Member
 
Join Date: Jan 2011
Location: Melbourne, Australia
Posts: 1
spymaster is on a distinguished road
Default Actually, you're not releasing the memory.

If you're displaying this view once for each image selection, then you will be creating a memory leak by allocating the image picker, but not releasing it.

The Apple sample releases the UIImagePickerController after an image has been selected. Your code doesn't do this.

This is the way to do it:
[picker release];

or

[picker autorelease];

From the code you posted, you're not doing this, so the previous allocs are sitting around in memory.

The reason your solution below alleviates the problem is that because you're conditionally allocating the picker, you only do it once.

Just thought I'd point this out to solve the mystery
spymaster is offline   Reply With Quote
 

» Advertisements
» Online Users: 447
14 members and 433 guests
Ananth, antonwilliams, carmeliaxw97, Chickenrig, dre, heshiming, Paul Slocum, Pitter20, Renrob, RETRO, ryantcb, st.Jimmy, UconnAggie, waterkamp
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,594
Threads: 94,083
Posts: 402,778
Top Poster: BrianSlick (7,990)
Welcome to our newest member, kopmlop
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:44 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.