Log in or register to post comments

Crash after init/destroy many time QCAR

November 11, 2011 - 12:39am #1

I'm using Frame Marker. My device IPhone 4, iOS5.

I need to create/destroy UIViewController which bound EAGLView many time. But after many time create/destroy (must perform create/destroy quickly.), app is crashed. Please see log bellow:

GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Fri Sep 16 06:56:50 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys002
sharedlibrary apply-load-rules all
target remote-mobile /tmp/.XcodeGDBRemote-207-64
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to process 7171 thread 0x1c03]
[Switching to process 7171 thread 0x1c03]
2011-11-11 15:24:27.353 Demo[874:707] EAGLView onCreate()
2011-11-11 15:24:27.402 Demo[874:4003] INFO: QCAR SDK version 1.0.0

2011-11-11 15:24:27.463 Demo[874:4003] WARNING: -[ setMinFrameDuration:] is deprecated. Please use AVCaptureConnection's -setVideoMinFrameDuration:
2011-11-11 15:24:27.402 Demo[874:707] EAGLView onResume()
2011-11-11 15:24:29.978 Demo[874:4003] INFO: http response: 204

2011-11-11 15:24:31.961 Demo[874:4003] QCAR::init percent: 100
2011-11-11 15:24:31.989 Demo[874:6123] INFO: Tracker starts loading

2011-11-11 15:24:32.020 Demo[874:6123] INFO: Found config.xml

2011-11-11 15:24:32.027 Demo[874:6123] INFO: Found config.xml

2011-11-11 15:24:32.036 Demo[874:6123] INFO: Tracker finished loading (no errors)

2011-11-11 15:24:32.038 Demo[874:707] INFO: UIView has CAEAGLLayer class

2011-11-11 15:24:32.042 Demo[874:707] INFO: UIView conforms to UIGLViewProtocol

2011-11-11 15:24:32.048 Demo[874:707] WARNING: -[ setMinFrameDuration:] is deprecated. Please use AVCaptureConnection's -setVideoMinFrameDuration:
2011-11-11 15:24:34.511 Demo[874:1b07] EAGLView onPause()
2011-11-11 15:24:34.813 Demo[874:1b07] EAGLView onDestroy()
2011-11-11 15:24:38.665 Demo[874:707] EAGLView onCreate()
2011-11-11 15:24:38.677 Demo[874:707] EAGLView onResume()
2011-11-11 15:24:41.037 Demo[874:3917] INFO: http response: 204

2011-11-11 15:24:43.413 Demo[874:3917] QCAR::init percent: 100
2011-11-11 15:24:43.422 Demo[874:707] INFO: UIView has CAEAGLLayer class

2011-11-11 15:24:43.427 Demo[874:707] INFO: UIView conforms to UIGLViewProtocol

2011-11-11 15:24:43.431 Demo[874:707] WARNING: -[ setMinFrameDuration:] is deprecated. Please use AVCaptureConnection's -setVideoMinFrameDuration:
2011-11-11 15:24:45.138 Demo[874:8e0b] EAGLView onPause()
2011-11-11 15:24:45.414 Demo[874:8e0b] EAGLView onDestroy()
2011-11-11 15:24:47.840 Demo[874:707] EAGLView onCreate()
2011-11-11 15:24:47.853 Demo[874:707] EAGLView onResume()
2011-11-11 15:24:48.942 Demo[874:707] EAGLView onPause()
2011-11-11 15:24:48.947 Demo[874:707] EAGLView onDestroy()
2011-11-11 15:24:49.812 Demo[874:707] EAGLView onCreate()
2011-11-11 15:24:49.826 Demo[874:707] EAGLView onResume()
2011-11-11 15:24:49.856 Demo[874:3923] INFO: http response: 204

2011-11-11 15:24:50.698 Demo[874:3923] QCAR::init percent: 100
(gdb)

Re: Crash after init/destroy many time QCAR

November 14, 2011 - 8:26pm #5

Thanks MoSR. Correct. I work now. But why QCAR connect to internet when creating. Before It just connected internet at first time. And never connect again. But now it always connect to internet.

Re: Crash after init/destroy many time QCAR

November 14, 2011 - 2:33am #4

Sorry I think you misunderstood my intent - you need to allow QCAR to completely initialise before you allow the user to back out and so commence the de-initialise.

Re: Crash after init/destroy many time QCAR

November 11, 2011 - 5:44pm #3

I'm sure that I destroy everything before creating new. I re-used total code of FrameMarker sample project.
I did:
- I have a ARCameraViewController(UIViewControl) which has EAGLView.
- When I need to use AR, I create new a ARCameraViewController and release this view controller when I don't need to use it. So When I create new ARCameraVIewController, EAGLView will run onCreate,onResume. And when I release ARCameraViewController, I make sure EAGLView run onPause, onDestroy before releasing.

- EAGLView will release when release ARCameraController. I checked it work correctly.
- I make sure that onCreate run after run onDestroy.
- It seem that there is a another thread hasn't completed when i call onCreate. Because sometime, I see message below after all or camera resource is in using:
[Switching to process 7171 thread 0x1c03]
[Switching to process 7171 thread 0x1c03]

Re: Crash after init/destroy many time QCAR

November 11, 2011 - 2:09am #2

Hi chungsavi,

Before we investigate further, it looks like you are onPause'ing and onDestroy'ing before the onCreate/onResume is complete.

If you are going to allow your user to do this in the UI you'll need to create some gates to allow the initialisation to complete before tearing it down again.

See if either a) you can reproduce the crash if you let the initialisation complete first and then b) what happens if you check for initialisation complete before allowing QCAR to be exited.

Log in or register to post comments