Changeset aa61317790b9d8764d4881771626846dd011296a

Show
Ignore:
Timestamp:
03/03/07 23:26:18 (2 years ago)
Author:
Sigmund Augdal Helberg <sigmunau@videolan.org>
git-committer:
Sigmund Augdal Helberg <sigmunau@videolan.org> 1172960778 +0000
git-parent:

[098b03f14ade630f4d2504554b8010f58d1bd8e2]

git-author:
Sigmund Augdal Helberg <sigmunau@videolan.org> 1172960778 +0000
Message:

when a reference to a object is stored the ref-count of that module
should be increased. Fixes a few crashes when input changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/qt4/input_manager.cpp

    rf56fb67 raa61317  
    4747InputManager::~InputManager() 
    4848{ 
     49    delInput(); 
    4950} 
    5051 
    5152void InputManager::setInput( input_thread_t *_p_input ) 
    5253{ 
     54    delInput(); 
    5355    p_input = _p_input; 
    5456    emit positionUpdated( 0.0,0,0 ); 
     
    5658    if( p_input ) 
    5759    { 
     60        vlc_object_yield( p_input ); 
    5861        vlc_value_t val; 
    5962        var_Change( p_input, "video-es", VLC_VAR_CHOICESCOUNT, &val, NULL ); 
     
    6467        var_AddCallback( p_input, "video-es", ChangeVideo, this ); 
    6568    } 
    66  
    67 
     69
     70 
    6871void InputManager::delInput() 
    6972{ 
     
    7275        var_DelCallback( p_input, "audio-es", ChangeAudio, this ); 
    7376        var_DelCallback( p_input, "video-es", ChangeVideo, this ); 
     77        vlc_object_release( p_input ); 
     78        p_input = NULL; 
    7479    } 
    7580} 
     
    8691        emit navigationChanged( 0 ); 
    8792        emit statusChanged( 0 ); // 0 = STOPPED, 1 = PLAY, 2 = PAUSE 
     93        delInput(); 
     94        return; 
    8895    } 
    8996