diff src/pixelarray.c @ 1137:ec3ced33488f

Reworked locking code to be more strict about locking. Added Surface.get_locks() method.
author marcus
date Mon, 16 Jun 2008 18:46:56 +0000
parents c4c38b97db3b
children 0e9e1bae4150
line wrap: on
line diff
--- a/src/pixelarray.c	Mon Jun 16 13:40:05 2008 +0000
+++ b/src/pixelarray.c	Mon Jun 16 18:46:56 2008 +0000
@@ -123,7 +123,7 @@
 {
     { "__dict__", (getter) _pxarray_get_dict, NULL, NULL, NULL },
     { "surface", (getter) _pxarray_get_surface, NULL, DOC_PIXELARRAYSURFACE,
-      NULL },
+      NULL }, 
     { NULL, NULL, NULL, NULL, NULL }
 };
 
@@ -226,7 +226,7 @@
         /* Initial PixelArray */
         if (surface)
         {
-            self->lock = PySurface_LockLifetime (surface);
+            self->lock = PySurface_LockLifetime (surface, (PyObject *) self);
             if (!self->lock)
             {
                 Py_DECREF (surface);
@@ -239,7 +239,7 @@
     {
         self->parent = parent;
         Py_INCREF (parent);
-        self->lock = ((PyPixelArray*) parent)->lock;
+        self->lock = ((PyPixelArray *)parent)->lock;
         Py_INCREF (self->lock);
     }