Commits

illume  committed d09261f

Fix for rw_close_th using helper after PyMem_Del(helper) is called.
A test for pygame.image.load(open(...))

  • Participants
  • Parent commits 8749d7c

Comments (0)

Files changed (2)

File src/rwobject.c

     Py_XDECREF (helper->write);
     Py_XDECREF (helper->read);
     Py_XDECREF (helper->close);
-    PyMem_Del (helper);
 
     PyThreadState_Swap (oldstate);
     PyThreadState_Clear (helper->thread);
     PyThreadState_Delete (helper->thread);
+
+    PyMem_Del (helper);
+
     PyEval_ReleaseLock ();
 
     SDL_FreeRW (context);

File test/image_test.py

 
         f = open(os.path.join("examples", "data", "alien1.jpg"), "rb")
         surf = pygame.image.load(f)
-
+        
+        surf = pygame.image.load(open(os.path.join("examples", "data", "alien1.jpg"), "rb"))
 
     def test_from_to_string(self):
         """ see if fromstring, and tostring methods are symetrical.