]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/string.qh
Add strfree to reduce explicit use of strunzone/string_null
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / string.qh
index 7142f334c15254b74b13908bdde8939eb1b9529b..96e8a3a276258d568380219e0b1d8218ac9b7cf5 100644 (file)
        this = strzone(s); \
 MACRO_END
 
+#define strfree(this) MACRO_BEGIN \
+       if (this) { \
+               strunzone(this); \
+       } \
+       this = string_null; \
+MACRO_END
+
 ERASEABLE
 string seconds_tostring(float sec)
 {