comparison src/context.cpp @ 128:1e4d4d475e75

Fixed GC issues w/ context dealloc.
author Atul Varma <varmaa@toolness.com>
date Sun, 23 Aug 2009 17:39:28 -0700
parents 4179d1e1a75c
children f956a6dea16c
comparison
equal deleted inserted replaced
127:4179d1e1a75c 128:1e4d4d475e75
103 static void 103 static void
104 PYM_JSContextDealloc(PYM_JSContextObject *self) 104 PYM_JSContextDealloc(PYM_JSContextObject *self)
105 { 105 {
106 if (self->weakrefs) 106 if (self->weakrefs)
107 PyObject_ClearWeakRefs((PyObject *) self); 107 PyObject_ClearWeakRefs((PyObject *) self);
108 PyObject_GC_UnTrack(self);
109
108 if (self->cx) { 110 if (self->cx) {
109 JS_DestroyContext(self->cx); 111 JS_DestroyContext(self->cx);
110 self->cx = NULL; 112 self->cx = NULL;
111 } 113 }
112 114
113 PYM_clear(self); 115 PYM_clear(self);
114 self->ob_type->tp_free((PyObject *) self); 116 PyObject_GC_Del(self);
115 } 117 }
116 118
117 static PyObject * 119 static PyObject *
118 PYM_getRuntime(PYM_JSContextObject *self, PyObject *args) 120 PYM_getRuntime(PYM_JSContextObject *self, PyObject *args)
119 { 121 {