From: terencehill Date: Fri, 15 Apr 2016 14:11:23 +0000 (+0200) Subject: Remove the buffer when hiding the cvar list X-Git-Tag: xonotic-v0.8.2~950^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=be47690f5cb1c0d3045833efc5a2c853a7fe44a6;p=xonotic%2Fxonotic-data.pk3dir.git Remove the buffer when hiding the cvar list --- diff --git a/qcsrc/menu/xonotic/cvarlist.qc b/qcsrc/menu/xonotic/cvarlist.qc index e41223277..74d85ca04 100644 --- a/qcsrc/menu/xonotic/cvarlist.qc +++ b/qcsrc/menu/xonotic/cvarlist.qc @@ -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; diff --git a/qcsrc/menu/xonotic/cvarlist.qh b/qcsrc/menu/xonotic/cvarlist.qh index 11ab45f35..2c99866cf 100644 --- a/qcsrc/menu/xonotic/cvarlist.qh +++ b/qcsrc/menu/xonotic/cvarlist.qh @@ -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));