Log in or register to post comments

Memory leaks in QCAR::Rectangle and eventually app crashes

October 25, 2012 - 3:39pm #1

Hi,

I see a lot of memory leaks in profiler at QCAR::Rectangle and when then app receives memory warning, then eventually destroyAR on QCARUtils gets called and this crashes the app at QCAR::deinit() call  with following exception:

 

 

AAQCARutils onDestroy()

AA(6460,0x3e62cce8) malloc: *** error for object 0x52f940: pointer being freed was not allocated

*** set a breakpoint in malloc_error_break to debug


Any idea on how to fix this?

 

 

 

Memory leaks in QCAR::Rectangle and eventually app crashes

October 26, 2012 - 2:45am #3

Hi saifulc,

Could you please clarify which sample this happens with and how to reproduce?

There may be some small leaks but it should not crash unless other changes have been introduced.

N

 

Memory leaks in QCAR::Rectangle and eventually app crashes

October 25, 2012 - 3:41pm #2

Here is the code for destroyAR method:

 

- (void)destroyAR

{

    NSLog(@"QCARutils onDestroy()");

    

    // Deinitialise QCAR SDK

    if (appStatus != APPSTATUS_UNINITED)

    {

        // deactivate the dataset and unload any pre-loaded datasets

        [self deactivateDataSet:currentDataSet];

 

        if (targetType != TYPE_FRAMEMARKERS)

        {

            // Unload all the requested datasets

            for (DataSetItem *aDataSet in targetsList)

            {

                if (aDataSet.dataSet != nil)

                {

                    [self unloadDataSet:aDataSet.dataSet];

                    aDataSet.dataSet = nil;

                }

            }

        }

        

        QCAR::deinit();

    }

    

    appStatus = APPSTATUS_UNINITED;

}

Log in or register to post comments