[vlc-devel] [PATCH 1/5] qt: varchoicemodel: don't create variables we already read from

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 13 15:00:28 CET 2020


A few lines above we do:
var_Get( m_object->get(), qtu(m_varname), &currentValue)

If the variable didn't exist we wouldn't reach this code.
---
 modules/gui/qt/util/varchoicemodel.hpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/modules/gui/qt/util/varchoicemodel.hpp b/modules/gui/qt/util/varchoicemodel.hpp
index 9f5b20729ad..658af82adfa 100644
--- a/modules/gui/qt/util/varchoicemodel.hpp
+++ b/modules/gui/qt/util/varchoicemodel.hpp
@@ -125,7 +125,6 @@ bool VLCVarChoiceModel::resetObject(T* p_object)
     {
         var_DelCallback(m_object->get(), qtu(m_varname), VLCVarChoiceModel::on_variable_callback, this);
         var_DelListCallback(m_object->get(), qtu(m_varname), VLCVarChoiceModel::on_variable_list_callback, this);
-        var_Destroy(m_object->get(), qtu(m_varname));
     }
     m_object->reset(p_object, true);
 
@@ -209,7 +208,6 @@ bool VLCVarChoiceModel::resetObject(T* p_object)
     free(val_list);
     free(val_title);
 
-    var_Create(m_object->get(), qtu(m_varname), m_type);
     var_AddCallback(m_object->get(), qtu(m_varname), VLCVarChoiceModel::on_variable_callback, this);
     var_AddListCallback(m_object->get(), qtu(m_varname), VLCVarChoiceModel::on_variable_list_callback, this);
 
-- 
2.17.1



More information about the vlc-devel mailing list