[qwaq] Pretend to call super init in edit buffer

This fixes the early deallocation of the edit buffer.
This commit is contained in:
Bill Currie 2020-03-30 16:51:09 +09:00
parent c23c68cf7f
commit 101574e697

View file

@ -7,6 +7,7 @@
#include <string.h> #include <string.h>
#include "QF/progs.h" #include "QF/progs.h"
#include "QF/ruamoko.h"
#include "QF/quakeio.h" #include "QF/quakeio.h"
#include "QF/txtbuffer.h" #include "QF/txtbuffer.h"
@ -532,6 +533,7 @@ bi_i_EditBuffer__init (progs_t *pr)
{ {
qwaq_ebresources_t *res = PR_Resources_Find (pr, "qwaq-editbuffer"); qwaq_ebresources_t *res = PR_Resources_Find (pr, "qwaq-editbuffer");
__auto_type self = &P_STRUCT (pr, qwaq_editbuffer_t, 0); __auto_type self = &P_STRUCT (pr, qwaq_editbuffer_t, 0);
RUA_obj_increment_retaincount (pr);// [super init];
txtbuffer_t *txtbuffer = TextBuffer_Create (); txtbuffer_t *txtbuffer = TextBuffer_Create ();
editbuffer_t *buffer = editbuffer_new (res); editbuffer_t *buffer = editbuffer_new (res);
@ -547,6 +549,7 @@ bi_i_EditBuffer__initWithFile_ (progs_t *pr)
{ {
qwaq_ebresources_t *res = PR_Resources_Find (pr, "qwaq-editbuffer"); qwaq_ebresources_t *res = PR_Resources_Find (pr, "qwaq-editbuffer");
__auto_type self = &P_STRUCT (pr, qwaq_editbuffer_t, 0); __auto_type self = &P_STRUCT (pr, qwaq_editbuffer_t, 0);
RUA_obj_increment_retaincount (pr);// [super init];
const char *filename = P_GSTRING (pr, 2); const char *filename = P_GSTRING (pr, 2);
txtbuffer_t *txtbuffer = TextBuffer_Create (); txtbuffer_t *txtbuffer = TextBuffer_Create ();
editbuffer_t *buffer = editbuffer_new (res); editbuffer_t *buffer = editbuffer_new (res);