]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/dialogs/open.cpp
Use pl_Release with the right argument.
[vlc] / modules / gui / wxwidgets / dialogs / open.cpp
index 3b92e19fd212f43cc1e4d3fa15479fa579005b4b..7430c62290d8bec87ab11ee5bbef3bd144f98ce8 100644 (file)
@@ -444,7 +444,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
             sout_button->Enable();
             subsfile_mrl.Add( wxString(wxT("sout=")) + wxL2U(psz_sout) );
         }
-        if( psz_sout ) free( psz_sout );
+        free( psz_sout );
 
         common_opt_sizer->Add( sout_button, 1, wxALIGN_LEFT |
                                wxALIGN_CENTER_VERTICAL );
@@ -588,9 +588,9 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
 OpenDialog::~OpenDialog()
 {
     /* Clean up */
-    if( file_dialog ) delete file_dialog;
-    if( sout_dialog ) delete sout_dialog;
-    if( subsfile_dialog ) delete subsfile_dialog;
+    delete file_dialog;
+    delete sout_dialog;
+    delete subsfile_dialog;
 }
 
 int OpenDialog::Show( int i_access_method, int i_arg )
@@ -661,7 +661,7 @@ wxPanel *OpenDialog::FilePanel( wxWindow* parent )
                         0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
     subfile_combo = new wxComboBox( panel, SubFileName_Event,
                                     wxL2U( psz_subsfile ) );
-    if( psz_subsfile ) free( psz_subsfile );
+    free( psz_subsfile );
     subbrowse_button = new wxButton( panel, SubFileBrowse_Event,
                                      wxU(_("Browse...")) );
     subfile_sizer->Add( subfile_combo, 1, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
@@ -1158,14 +1158,12 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
     }
 
     /* Update the playlist */
-    playlist_t *p_playlist =
-        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                       FIND_ANYWHERE );
+    playlist_t *p_playlist = pl_Yield( p_intf );
     if( p_playlist == NULL ) return;
 
     for( int i = 0; i < (int)mrl.GetCount(); i++ )
     {
-        vlc_bool_t b_start = !i && i_open_arg;
+        bool b_start = !i && i_open_arg;
         input_item_t *p_input;
         char *psz_utf8;
 
@@ -1208,10 +1206,10 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
         /* FIXME: playlist_AddInput() can fail */
         playlist_AddInput( p_playlist, p_input,
                PLAYLIST_APPEND | ( b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE ),
-               PLAYLIST_END, VLC_TRUE, VLC_FALSE );
+               PLAYLIST_END, true, pl_Unlocked );
+        vlc_gc_decref( p_input );
     }
-
-    vlc_object_release( p_playlist );
+    pl_Release( p_intf );
 
     Hide();
 
@@ -1632,7 +1630,7 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
         break;
     }
 
-    free(psz_device);
+    free( psz_device );
     disc_probe->SetValue(FALSE);
 
     UpdateMRL( DISC_ACCESS );
@@ -1746,7 +1744,7 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
     disc_title->SetValue( 0 ); i_disc_title = 0;
     disc_chapter->SetValue( 0 ); i_disc_chapter = 0;
 
-    if( psz_device ) free( psz_device );
+    free( psz_device );
 
     UpdateMRL( DISC_ACCESS );
 }
@@ -1883,7 +1881,7 @@ void OpenDialog::OnCachingChange( wxCommandEvent& event )
  *****************************************************************************/
 wxArrayString SeparateEntries( wxString entries )
 {
-    vlc_bool_t b_quotes_mode = VLC_FALSE;
+    bool b_quotes_mode = false;
 
     wxArrayString entries_array;
     wxString entry;
@@ -1900,13 +1898,13 @@ wxArrayString SeparateEntries( wxString entries )
         {
             /* Enters quotes mode */
             entry.RemoveLast();
-            b_quotes_mode = VLC_TRUE;
+            b_quotes_mode = true;
         }
         else if( b_quotes_mode && entry.Last() == wxT('\"') )
         {
             /* Finished the quotes mode */
             entry.RemoveLast();
-            b_quotes_mode = VLC_FALSE;
+            b_quotes_mode = false;
         }
         else if( !b_quotes_mode && entry.Last() != wxT('\"') )
         {