Commit 7690c562 authored by emerit's avatar emerit
Browse files

bug fix and missing switch

parent 034573a8
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -2082,8 +2082,10 @@ cleanup:
    RotationFileReader_close( &referenceRotReader );
    RotationFileReader_close( &referenceRotReader );


    Vector3PairFileReader_close( &referenceVectorReader );
    Vector3PairFileReader_close( &referenceVectorReader );
#ifndef FIX_2249_MEMORY_LEAK_IN_SBA
    destroy_td_hrtf( hHrtfTD );
    destroy_td_hrtf( hHrtfTD );
    destroy_hrtf_statistics( hHrtfStatistics );
    destroy_hrtf_statistics( hHrtfStatistics );
#endif
    IVAS_REND_Close( &hIvasRend );
    IVAS_REND_Close( &hIvasRend );
    IsmPositionProvider_close( positionProvider );
    IsmPositionProvider_close( positionProvider );
    RenderConfigReader_close( &renderConfigReader );
    RenderConfigReader_close( &renderConfigReader );
+4 −0
Original line number Original line Diff line number Diff line
@@ -3023,7 +3023,11 @@ void ivas_destroy_dec(
    ivas_HRTF_parambin_binary_close( &st_ivas->hHrtfParambin );
    ivas_HRTF_parambin_binary_close( &st_ivas->hHrtfParambin );


    /* HRTF statistics */
    /* HRTF statistics */
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA    
    ivas_HRTF_statistics_binary_close( &st_ivas->hHrtfStatistics );
    ivas_HRTF_statistics_binary_close( &st_ivas->hHrtfStatistics );
#else
    ivas_HRTF_statistics_close( &st_ivas->hHrtfStatistics );
#endif


    /* Config. Renderer */
    /* Config. Renderer */
    ivas_render_config_close( &( st_ivas->hRenderConfig ) );
    ivas_render_config_close( &( st_ivas->hRenderConfig ) );
+6 −3
Original line number Original line Diff line number Diff line
@@ -3268,11 +3268,14 @@ ivas_error IVAS_REND_Open(
    if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    {
    {
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
#ifdef FIX_2249_MEMORY_LEAK_IN_SBA
        if ( hIvasRend->hHrtfs.hHrtfStatistics == NULL )
        {
            /* Allocate HRTF statistics */
            /* Allocate HRTF statistics */
            if ( ( error = ivas_HRTF_statistics_binary_open( &( hIvasRend->hHrtfs.hHrtfStatistics ) ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_HRTF_statistics_binary_open( &( hIvasRend->hHrtfs.hHrtfStatistics ) ) ) != IVAS_ERR_OK )
            {
            {
                return error;
                return error;
            }
            }
        }


        /* Init HRTF statistics */
        /* Init HRTF statistics */
        if ( ( error = ivas_HRTF_statistics_init_from_rom( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_HRTF_statistics_init_from_rom( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK )