diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 81fd6a02251f431a0818f8bb52e9d0750eb15d8c..83d4833a0e484f53ea784a116550a413d8680d14 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -1056,7 +1056,7 @@ void KeySelectorControl::finish()
         }
     }
     module_PutConfig (p_config);
-    module_Put (p_module);
+    module_Put (p_main);
 
     table->resizeColumnToContents( 0 );