]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
DP_EF_RESTARTANIM_BIT
[xonotic/darkplaces.git] / console.c
index fc29e5f789742f22a297d8e6891c335508990222..71a5f86928ccea41619a75c690db6287bb0eea85 100644 (file)
--- a/console.c
+++ b/console.c
@@ -28,9 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 float con_cursorspeed = 4;
 
-#define                CON_TEXTSIZE    1048576
-#define                CON_MAXLINES      16384
-
 // lines up from bottom to display
 int con_backscroll;
 
@@ -95,6 +92,7 @@ char rcon_redirect_buffer[1400];
 
 void ConBuffer_Init(conbuffer_t *buf, int textsize, int maxlines, mempool_t *mempool)
 {
+       buf->active = true;
        buf->textsize = textsize;
        buf->text = (char *) Mem_Alloc(mempool, textsize);
        buf->maxlines = maxlines;
@@ -120,6 +118,7 @@ ConBuffer_Shutdown
 */
 void ConBuffer_Shutdown(conbuffer_t *buf)
 {
+       buf->active = false;
        Mem_Free(buf->text);
        Mem_Free(buf->lines);
        buf->text = NULL;
@@ -230,6 +229,10 @@ void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, int mask)
        char *putpos;
        con_lineinfo_t *p;
 
+       // developer_memory 1 during shutdown prints while conbuffer_t is being freed
+       if (!buf->active)
+               return;
+
        ConBuffer_FixTimes(buf);
 
        if(len >= buf->textsize)