Low Memory Warning Crashes Corona

Running on Corona Beta 8 and get the following error when running on an iPhone4 (IOS 4.0.2). This occurs right after tapping the icon to launch the application and before the application displays any graphics. Its not repeatable, but it is frequent (about 1 out of 10 launches.)
Incident Identifier: 1C144D4A-BCCC-4BB6-93AA-5FD744BD8959
CrashReporter Key: 184a9f4476ec6155c620e7e7822fa1896d4384f9
Hardware Model: iPhone3,1
Process: NebulaOne [2981]
Path: /var/mobile/Applications/85718FD2-460A-4938-97DE-33D156D20F46/NebulaOne.app/NebulaOne
Identifier: NebulaOne
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]

Date/Time: 2010-09-13 18:23:43.176 -0700
OS Version: iPhone OS 4.0.2 (8A400)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000034
Crashed Thread: 0

Thread 0 Crashed:
0 NebulaOne 0x00012e04 0x1000 + 73220
1 NebulaOne 0x00002d92 0x1000 + 7570
2 UIKit 0x0014f21e -[UIApplication didReceiveMemoryWarning] + 38
3 UIKit 0x00151142 -[UIApplication _performMemoryWarning] + 10
4 UIKit 0x001523ec -[UIApplication _receivedMemoryNotification] + 120
5 UIKit 0x0014f19c _memoryStatusChanged + 36
6 CoreFoundation 0x0006a99e __CFNotificationCenterDarwinCallBack + 18
7 CoreFoundation 0x000676a0 __CFMachPortPerform + 204
8 CoreFoundation 0x00071aa4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
9 CoreFoundation 0x00073848 __CFRunLoopDoSource1 + 160
10 CoreFoundation 0x00074626 __CFRunLoopRun + 514
11 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
12 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
13 GraphicsServices 0x000036e8 GSEventRunModal + 108
14 GraphicsServices 0x00003794 GSEventRun + 56
15 UIKit 0x000062a0 -[UIApplication _run] + 396
16 UIKit 0x00004e10 UIApplicationMain + 664
17 NebulaOne 0x000022dc 0x1000 + 4828
18 NebulaOne 0x00002278 0x1000 + 4728

Thread 1:
0 libSystem.B.dylib 0x0002dc4c kevent + 24
1 libSystem.B.dylib 0x000d6e44 _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x000d6894 _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x000d6a34 _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x0007ad82 _pthread_wqthread + 258
5 libSystem.B.dylib 0x00073fcc start_wqthread + 0

Thread 2:
0 libSystem.B.dylib 0x00001658 mach_msg_trap + 20
1 libSystem.B.dylib 0x00003724 mach_msg + 44
2 CoreFoundation 0x000722c8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x00074582 __CFRunLoopRun + 350
4 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
6 WebCore 0x00003056 RunWebThread(void*) + 362
7 libSystem.B.dylib 0x0007a986 _pthread_start + 242
8 libSystem.B.dylib 0x000700e4 thread_start + 0

Thread 3:
0 libSystem.B.dylib 0x0007b85c __workq_kernreturn + 8
1 libSystem.B.dylib 0x0007ae98 _pthread_wqthread + 536
2 libSystem.B.dylib 0x00073fcc start_wqthread + 0

Thread 4:
0 libSystem.B.dylib 0x0007b85c __workq_kernreturn + 8
1 libSystem.B.dylib 0x0007ae98 _pthread_wqthread + 536
2 libSystem.B.dylib 0x00073fcc start_wqthread + 0

Thread 0 crashed with ARM Thread State:
r0: 0x2fffebcc r1: 0x00000000 r2: 0x0012fa20 r3: 0x00000001
r4: 0x00000000 r5: 0x2fffec20 r6: 0x00110f10 r7: 0x2fffebdc
r8: 0x2fffed98 r9: 0x001fc098 r10: 0x00000018 r11: 0x00000001
ip: 0x3e467044 sp: 0x2fffebcc lr: 0x00014174 pc: 0x00012e04
cpsr: 0x000f0010

Binary Images:
0x1000 - 0x4efff +NebulaOne armv7 <47e9da7e42a9a7ee100921c3e71b417f> /var/mobile/Applications/85718FD2-460A-4938-97DE-33D156D20F46/NebulaOne.app/NebulaOne
0xd2000 - 0xd3fff dns.so armv7 <240b8d3f07b4fcb234de598f8e67de1a> /usr/lib/info/dns.so
0x2fe00000 - 0x2fe26fff dyld armv7 <193570c1391880df7da870149117e49e> /usr/lib/dyld
0x30135000 - 0x30686fff WebCore armv7 <859bdd351085819fb4da07d12b41543f> /System/Library/PrivateFrameworks/WebCore.framework/WebCore
0x30ac5000 - 0x30adafff libresolv.9.dylib armv7 <1ed920d5a995cd94e71c41631d7c551e> /usr/lib/libresolv.9.dylib
0x30adc000 - 0x30bc4fff libGLProgrammability.dylib armv7 <9bcf5fe3e7abc344425e581ff2896579> /System/Library/Frameworks/OpenGLES.framework/libGLProgrammability.dylib
0x30ca5000 - 0x30d4bfff WebKit armv7 /System/Library/PrivateFrameworks/WebKit.framework/WebKit
0x30e03000 - 0x30ea6fff IMGSGX535GLDriver armv7 /System/Library/Extensions/IMGSGX535GLDriver.bundle/IMGSGX535GLDriver
0x30eb4000 - 0x30f76fff CFNetwork armv7 <9fdd61632fd1b48d65daba561528946f> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x30f77000 - 0x30f7ffff MobileBluetooth armv7 <0bd0c65f4350b5d81f81449fae029a04> /System/Library/PrivateFrameworks/MobileBluetooth.framework/MobileBluetooth
0x310a5000 - 0x310a7fff CrashReporterSupport armv7 /System/Library/PrivateFrameworks/CrashReporterSupport.framework/CrashReporterSupport
0x310a8000 - 0x3113ffff MediaPlayer armv7 <2c4b66a2002c1b3222f70c71d8844455> /System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
0x31297000 - 0x3129cfff MobileKeyBag armv7 /System/Library/PrivateFrameworks/MobileKeyBag.framework/MobileKeyBag
0x3129f000 - 0x312e7fff libBLAS.dylib armv7 <3b4a2849c10d100a178a3c2d9f6af523> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
0x312e8000 - 0x312e9fff DataMigration armv7 <2a90bcfdd519f8d7d3487151c77443ed> /System/Library/PrivateFrameworks/DataMigration.framework/DataMigration
0x312ea000 - 0x31358fff ProofReader armv7 <479bd40ac65cb7e6c3000d79d649571f> /System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
0x31359000 - 0x3142bfff CoreFoundation armv7 <17c9c36ae8824496b507446869cd4d9d> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x31472000 - 0x314a0fff AppSupport armv7 <2a64271b39599b2180d0dfd3141027ee> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x31663000 - 0x3280dfff UIKit armv7 <6c767127e477e6ac7b7f083857ca8064> /System/Library/Frameworks/UIKit.framework/UIKit
0x32824000 - 0x32868fff libsqlite3.dylib armv7 <36b9bc7d02e29c8d321dd0d7bf7e115e> /usr/lib/libsqlite3.dylib
0x3286b000 - 0x3286dfff IOMobileFramebuffer armv7 <1fdf9182a63464743901526caf39240a> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer
0x329b6000 - 0x329ccfff RawCamera armv7 <78168f60a21e67ce307c5ce30054dba6> /System/Library/CoreServices/RawCamera.bundle/RawCamera
0x329dc000 - 0x329e2fff liblockdown.dylib armv7 /usr/lib/liblockdown.dylib
0x329e3000 - 0x329ebfff libgcc_s.1.dylib armv7 /usr/lib/libgcc_s.1.dylib
0x329f0000 - 0x329fbfff GraphicsServices armv7 <7194df9e594ae0fd9d9c600ccf456a08> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x329fc000 - 0x32a46fff libstdc++.6.dylib armv7 /usr/lib/libstdc++.6.dylib
0x32aa3000 - 0x32ad2fff VideoToolbox armv7 <4c4faee61a6e7d80d6d3a58194075642> /System/Library/PrivateFrameworks/VideoToolbox.framework/VideoToolbox
0x32ad3000 - 0x32ad5fff libAccessibility.dylib armv7 <06dd6032c40b1feb094d63eeb2002d6d> /usr/lib/libAccessibility.dylib
0x32ad6000 - 0x32b16fff ManagedConfiguration armv7 <94f3f69708e8f008b3f092430f46e4b6> /System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration
0x32b17000 - 0x32b59fff CoreTelephony armv7 /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x32b98000 - 0x32b9bfff IOSurface armv7 /System/Library/PrivateFrameworks/IOSurface.framework/IOSurface
0x32bb6000 - 0x32bb6fff vecLib armv7 <85f89752df7814c1b243c26f59388523> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
0x32bbf000 - 0x32bc2fff ApplePushService armv7 <0477bf826cbba75183069e1e80879a99> /System/Library/PrivateFrameworks/ApplePushService.framework/ApplePushService
0x32d49000 - 0x32de7fff Celestial armv7 <7a01b8d8cd2054d9b0d987bda6c52d9c> /System/Library/PrivateFrameworks/Celestial.framework/Celestial
0x32de8000 - 0x32f06fff CoreGraphics armv7 <4022bbf12f11dd1f6b75662c764e7f7c> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x32f42000 - 0x3302afff GLEngine armv7 /System/Library/Frameworks/OpenGLES.framework/GLEngine.bundle/GLEngine
0x3302b000 - 0x330cbfff libobjc.A.dylib armv7 <89553a61e05078fd178ac0ea2081ae40> /usr/lib/libobjc.A.dylib
0x3325a000 - 0x33379fff Foundation armv7 /System/Library/Frameworks/Foundation.framework/Foundation
0x3344f000 - 0x33489fff IOKit armv7 <5e0169de165c2fd25a2ddac1f3e19d06> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x33543000 - 0x33640fff MusicLibrary armv7 /System/Library/PrivateFrameworks/MusicLibrary.framework/MusicLibrary
0x33641000 - 0x33680fff libGLImage.dylib armv7 /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
0x33681000 - 0x33683fff MobileInstallation armv7 <74e2bd725da63513053b4fa41d8cd89c> /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
0x33684000 - 0x3368dfff ITSync armv7 /System/Library/PrivateFrameworks/ITSync.framework/ITSync
0x3368e000 - 0x3371bfff ImageIO armv7 /System/Library/Frameworks/ImageIO.framework/ImageIO
0x33850000 - 0x33969fff libicucore.A.dylib armv7 /usr/lib/libicucore.A.dylib
0x33ad1000 - 0x33bf3fff MediaToolbox armv7 /System/Library/PrivateFrameworks/MediaToolbox.framework/MediaToolbox
0x33c21000 - 0x33c6afff GMM armv7 <9c4efdff49ea9e6a17b5d44bcd98b6c1> /System/Library/PrivateFrameworks/GMM.framework/GMM
0x33c6f000 - 0x33c87fff libRIP.A.dylib armv7 <436e3b257ba088ca6f773961ce619892> /System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
0x33c88000 - 0x33c8bfff libGFXShared.dylib armv7 <12f82e44ff36b29f8d0661878be83554> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
0x33c8c000 - 0x33c8ffff ArtworkCache armv7 <8ff796d092ff1a8289611912506bbe44> /System/Library/PrivateFrameworks/ArtworkCache.framework/ArtworkCache
0x33c9d000 - 0x33ccefff CoreLocation armv7 <722c5983f0589013d0243e2512d0dd1b> /System/Library/Frameworks/CoreLocation.framework/CoreLocation
0x33e36000 - 0x33edefff QuartzCore armv7 <109b4f6a3d2ee5aa1bb5775ab5a489bc> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x33ee2000 - 0x33f8bfff libxml2.2.dylib armv7 <1d74fa3a5cec309857503a51cb2df667> /usr/lib/libxml2.2.dylib
0x34035000 - 0x342cffff libLAPACK.dylib armv7 /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
0x343a8000 - 0x343b1fff CoreVideo armv7 <58180e899ec56cd8bca00221dea2bc32> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
0x343b2000 - 0x343b6fff AssetsLibraryServices armv7 <942a91e5920a8798c1a1cf75f0750b2f> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
0x343ee000 - 0x3442cfff libvDSP.dylib armv7 /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
0x3442d000 - 0x34435fff libkxld.dylib armv7 <4ec35c4d1e1e73416aea84537829ce91> /usr/lib/system/libkxld.dylib
0x34438000 - 0x34445fff OpenGLES armv7 /System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x344e8000 - 0x34521fff MobileCoreServices armv7 /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x3456c000 - 0x3459bfff CoreText armv7 <76eb1b63d684c3d21dba9e8129666d2f> /System/Library/Frameworks/CoreText.framework/CoreText
0x3459c000 - 0x345d2fff Security armv7 <7cea1027f1a381b8d6c5ffae4dae0d22> /System/Library/Frameworks/Security.framework/Security
0x3473c000 - 0x347dbfff JavaScriptCore armv7 <894df23ebbc4df713d9519141a61dd19> /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
0x347dc000 - 0x347ddfff CoreSurface armv7 <042e433142b7faa4c96b23e555faaf13> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface
0x3483a000 - 0x34843fff AccountSettings armv7 /System/Library/PrivateFrameworks/AccountSettings.framework/AccountSettings
0x34844000 - 0x3484bfff libbz2.1.0.dylib armv7 <5d079712f5a39708647292bccbd4c4e0> /usr/lib/libbz2.1.0.dylib
0x3487c000 - 0x348aafff SystemConfiguration armv7 <2b44ac2fc47fc45c4006d08019688dbb> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x348ac000 - 0x348b7fff libz.1.dylib armv7 <19a78978d5908bedc6496470fe542936> /usr/lib/libz.1.dylib
0x348e9000 - 0x34929fff CoreAudio armv7 <1723726845b73efbeca75b33d75f335a> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x34936000 - 0x3493dfff MobileWiFi armv7 <6d417a70ec3abd8258ed0fbab0994518> /System/Library/PrivateFrameworks/MobileWiFi.framework/MobileWiFi
0x3493e000 - 0x3496cfff libCGFreetype.A.dylib armv7 <475259824770c6ff1b63f30238b3ea81> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib
0x349a4000 - 0x349c3fff Bom armv7 /System/Library/PrivateFrameworks/Bom.framework/Bom
0x34a2d000 - 0x34c6bfff ProtocolBuffer armv7 <83f1b1c1956ed14bf6f6c7923ee9f2fc> /System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer
0x34cb8000 - 0x34ccefff EAP8021X armv7 <4177ec92cd0e2a4a23c79fac68de5c2e> /System/Library/PrivateFrameworks/EAP8021X.framework/EAP8021X
0x34dc3000 - 0x34dd4fff PersistentConnection armv7 <5e827d18f317b5ce7c61c91656ebc88e> /System/Library/PrivateFrameworks/PersistentConnection.framework/PersistentConnection
0x34dd5000 - 0x34e07fff AddressBook armv7 <3dde743216bbf016019b59f821dda6e3> /System/Library/Frameworks/AddressBook.framework/AddressBook
0x34e0f000 - 0x34e12fff libMobileGestalt.dylib armv7 <85f01f53a7455a34fbdedc76bd692d74> /usr/lib/libMobileGestalt.dylib
0x34f43000 - 0x34f4ffff SpringBoardServices armv7 <7624f0a9e197261f2df43edb86ba0256> /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
0x34f50000 - 0x34f5dfff libbsm.0.dylib armv7 <27ad6b3a74ce1068586eabd6a553183f> /usr/lib/libbsm.0.dylib
0x34f5e000 - 0x34f64fff IAP armv7 <42a87fc47e059f5a73dcff2227b9e0be> /System/Library/PrivateFrameworks/IAP.framework/IAP
0x34f67000 - 0x34f7afff libmis.dylib armv7 <9fbf2930731e2da9863eacdff8b121a2> /usr/lib/libmis.dylib
0x3502d000 - 0x35151fff AudioToolbox armv7 <802e4d5c449b69d9552809e5230baa84> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x35156000 - 0x35156fff Accelerate armv7 /System/Library/Frameworks/Accelerate.framework/Accelerate
0x3518f000 - 0x351c9fff CoreMedia armv7 <6df383495d1acd2b036ad674a29d75c1> /System/Library/Frameworks/CoreMedia.framework/CoreMedia
0x351fb000 - 0x35308fff libSystem.B.dylib armv7 <3fcf32f3ad8ef745480b5b36efc41953> /usr/lib/libSystem.B.dylib
[import]uid: 4537 topic_id: 2126 reply_id: 302126[/import]

I’ve seen this problem with iPhone 4 and I believe it’s because IOS4 keeps apps in the background. Corona doesn’t support background mode but IOS4 still backgrounds the apps which can cause low memory if there are enough apps are in this mode.

Try killing the backgrounded apps by double tapping the home button and kill the "running"apps (press and hold the app and touch X to kill).

=-Tom [import]uid: 7559 topic_id: 2126 reply_id: 6353[/import]

Hope Apple fixes the problem. My concern is: why does Corona crash when it receives the low memory warning? Shouldn’t it exit gracefully? Or more importantly, free any memory it can and stay running until iOS sends it a “application end” event? [import]uid: 4537 topic_id: 2126 reply_id: 6398[/import]

Actually, your app needs to reduce it’s memory use when it receives the low memory warning. Corona only reports the event and can’t do anything to keep it from crashing if you app doesn’t respect the warning.

-Tom [import]uid: 7559 topic_id: 2126 reply_id: 6438[/import]

Thanks for your prompt reply Tom - appreciate it.

I feel like we’re talking about two different things. There is no low memory event sent to the Lua code. It crashes before the event is sent. The EXC_BAD_ACCESS (SIGBUS) is an Objective-C pointer violation.

And I’m not sure what I can do to release memory. The program is just starting up and there aren’t images loaded yet.

Just to make sure I understand your commnet, are you saying iOS4 will crash a program during a low memory warning rather than terminate it?
[import]uid: 4537 topic_id: 2126 reply_id: 6444[/import]

You have to add a Low Memory listener to receive the low memory warning. This was added in Beta 8

Runtime:addEventListener("memoryWarning", mlistener) -- where mlistener is the function called  

(It sounds like you added this listener but I included it here for others reading this thread.)

You should not be getting this problem when your app first starts unless there are a lot of apps pushed to the background. When this happens did you remove all the background apps (like I mentioned earlier)?

Does this happen on all apps you build and run or only certain ones? I’m assuming you are building with the new Corona SDK (not Beta).

Can you try adding the following to the build.settings file to see if it fixes the problem?

settings =  
{  
 iphone =  
 {  
 plist =  
 {  
 UIApplicationExitsOnSuspend = true  
 },  
 }  
}  
  

This code will make sure the app is killed and not placed into the IOS4 background mode.

Thanks,
-Tom [import]uid: 7559 topic_id: 2126 reply_id: 6456[/import]

The error in the first post is based upon Corona Beta-8. I have another application in development that I tried on Corona 2.0 and it exhibits the same problem. I will update the first post to Corona 2.0 and give it a try.

I will try to the build.settings recommendation to see if it fixes it. I like this setting and will use it in the future, but I’m not sure what your trying to fix with it. If the iPhone is trying to load my app, my app won’t be inactive. Are you thinking this might have to do with the app already being inactive and the iPhone is trying to re-activate it?

I haven’t tried the “clear all applications” yet because I have no way of getting all the iPhone users to do this. :slight_smile:
[import]uid: 4537 topic_id: 2126 reply_id: 6540[/import]

Tom,

i am testing an app built with GameEditionBeta in iOs4.

if i do not include a build.settings file then the next time the app is launched i do not see the Default.png file but a screenshot of what was on the screen when i exited the app (the buttons are not functional, it appears to be an image)! it is obvious that the app is kept in memory. i have an onSystemEvent handler that is not doing anything other than printing the event.type.

if i do include the build.settings file that you mention above, then the next time the app is launched i see the Default.png image, but on the Console i see a crash report created when i exited the app:

Notice: Formulating crash report for process applicationName
Error: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/… etc
Warning: (UIKitApplication:applicationName) Job appears to have crashed: Bus error
Warning: Application ‘applicationName’ exited abnormally with signal 10: Bus error

on the device log i see this:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000034

which is the same with ToaTerra’s

the application is working fine after relaunch, but crashes again on exit (every time i exit, not in 1 out of 10 exits)…

what is causing the crash? that single line in the build.settings file?
the code is identical for both tests
[import]uid: 6459 topic_id: 2126 reply_id: 6762[/import]

i just found out that none of these problems occur when the app is built using Corona Game Edition Alpha 3

if do not include a build.settings file, at relaunch the app starts with the Default.png image as expected, and if i do the app doesn’t crash at exit.
everything works the way it should, even tough the app was not built for iPhone4

as far as i understand the problem is in the implementation of building apps for iPhone4 (3 compatible)

i hope that helps [import]uid: 6459 topic_id: 2126 reply_id: 6780[/import]

Game Edition Alpha 3 still used ISO 3 builds, which doesn’t put the app in the background which is why you are seeing a difference. With GE Beta and Corona Beta 8 and Corona SDK, the builds are IOS 4 which puts the app into background mode when the Home button is pressed. When the app is restarted, Corona will initialize it like it was starting from the beginning. Adding the line to the build.settings file will cause the app to exit when the Home button is pressed.

I have seen apps crashing when there are too many apps in the background, but haven’t seen that lately with Corona SDK. In Corona SDK we do a better job of freeing resources when the Home button is pressed which I think helps. We have merged the Corona SDK changes in the next release of Game Edition, which should be released very soon. I would suggest testing with the new GE release when it comes out to see if you are still having problems.

-Tom [import]uid: 7559 topic_id: 2126 reply_id: 7030[/import]

Tom,

i started with Corona in May, and i already have 9 versions of it installed!!! and i don’t know whether i missed a release. Corona staff answer questions even on weekends, as you did.

i am sure that when GE comes out of beta, and includes the features of the SDK, there will be no bugs like the one i describe above.

how soon is very soon?

[import]uid: 6459 topic_id: 2126 reply_id: 7090[/import]

Tom,

i included the build.settings file in an app built with Game Edition 2010.109 and there was crash on iPhone4
app exit and relaunch both work fine
no need for a system applicationExit handler (with os.exit() to avoid iOS4 crash)

keep up the good work!

[import]uid: 6459 topic_id: 2126 reply_id: 7679[/import]

@tetu,

What was your final fix for the crash problem?

Are you saying the build.settings file (with the exit fix) causes a crash on iPhone4 with GE?

I’m trying to determine if there is still a crash problem with iPhone4 and our latest SDK and GE products.

Thanks,
-Tom [import]uid: 7559 topic_id: 2126 reply_id: 7788[/import]

Tom,

with the GE Beta (not the SDK) including the build.settings file in the app, would crash iPhone4 (with and without a system applicationExit handler)
the workaround was to include a system applicationExit handler with the os.exit command and to omit the settings file

with GE2010.109, the build.settings file works just fine. there’s no need for a handler function (unless you want to store data of course)

no crash problems whatsoever, the app exits the way it should.

[import]uid: 6459 topic_id: 2126 reply_id: 7800[/import]

So it sounds like GE 2010.109 fixes the iPhone crash problem and doesn’t require the special build.settings fix nor the os.exit() call.

Both Corona SDK 148 and GE 109 use the same code base so I’m assuming this problem is resolved in the current shipping products.

Thanks,
-Tom [import]uid: 7559 topic_id: 2126 reply_id: 7806[/import]