Qt: do not free module config too early
authorEdward Wang <edward.c.wang@compdigitec.com>
Mon, 19 Aug 2013 03:17:16 +0000 (23:17 -0400)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 19 Aug 2013 09:44:51 +0000 (11:44 +0200)
commit563ceaea62284eb7151aa382e68fefae615dee74
tree6738fdc5bd7bf57afd1f5cf4b8ebdbe3593321a4
parent0e7d446bf01de2ac385092120979e3c475ccfc3f
Qt: do not free module config too early

Fix regression introduced in 95f145933a553e082eb42577d72dbf8bdea9972b

ConfigControl::getName() uses memory of p_item which is a part of p_config memory. This was causing a crash when trying to save the preferences, as the constructor had already destroyed it upon creation.

Instead, free the p_config memory on the destructor, which is automatically called when the dialog closes, saved or cancelled. Verified to not leak any memory.

Close #9214

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 58b5ae72eff59365220024c970a8b44224b42c3d)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/complete_preferences.cpp
modules/gui/qt4/components/complete_preferences.hpp