]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove the buffer when hiding the cvar list
authorterencehill <piuntn@gmail.com>
Fri, 15 Apr 2016 14:11:23 +0000 (16:11 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 15 Apr 2016 14:11:23 +0000 (16:11 +0200)
qcsrc/menu/xonotic/cvarlist.qc
qcsrc/menu/xonotic/cvarlist.qh

index e41223277f77f8790c1b9fcd33041cf04af6b749..74d85ca04ce059fb29abe7bcf520de3bbf97dab3 100644 (file)
@@ -46,9 +46,17 @@ void XonoticCvarList_showNotify(entity me)
        if(force_initial_selection)
                me.setSelected(me, 0);
 }
+void XonoticCvarList_hideNotify(entity me)
+{
+       if(me.handle)
+               buf_del(me.handle);
+       me.handle = buf_create();
+       me.nItems = 0;
+}
 void XonoticCvarList_destroy(entity me)
 {
-       buf_del(me.handle);
+       if(me.handle)
+               buf_del(me.handle);
 }
 string autocvar_menu_forced_saved_cvars;
 string autocvar_menu_reverted_nonsaved_cvars;
index 11ab45f351e0a7fba377d7daec1aec4c72edff83..2c99866cf7671d7bf35c9cdf438c7f2dbcdeeea7 100644 (file)
@@ -8,6 +8,7 @@ CLASS(XonoticCvarList, XonoticListBox)
        METHOD(XonoticCvarList, resizeNotify, void(entity, vector, vector, vector, vector));
        METHOD(XonoticCvarList, keyDown, float(entity, float, float, float));
        METHOD(XonoticCvarList, showNotify, void(entity));
+       METHOD(XonoticCvarList, hideNotify, void(entity));
 
        METHOD(XonoticCvarList, destroy, void(entity));