1. pygame
  2. pygame
  3. pygame

Commits

pygame  committed ea2f464

rect leak

  • Participants
  • Parent commits b3e2bd6
  • Branches default

Comments (0)

Files changed (4)

File CREDITS

View file
  • Ignore whitespace
 
 - David Clark for packaging and help with releases
 
+- Francis Irving for Debian packaging
+
+- Niki Spahiev for bugfixes
+
 - Jan Ekhol, Ray Kelm, and Peter Nicolai for initial design advise
 
 - Python and the team behind it, headed by Guido van Rossum

File WHATSNEW

View file
  • Ignore whitespace
 # BREAK = change breaks existing code
 # BUG   = fixed a bug that was crashing
 
+Mar 16, 2001
+	Fixed memory leak in Rect constructor
+	Fixed improper exception in update.display
+
 Feb 15, 2001
 	calling Sound.play() will make sure the channel
 		that gets selected has volume set to full

File src/display.c

View file
  • Ignore whitespace
 	else
 	{
 		gr = GameRect_FromObject(arg, &temp);
-		if(gr && gr != &temp)
+		if(!gr)
+			PyErr_Clear();
+		else if(gr != &temp)
 		{
 			memcpy(&temp, gr, sizeof(temp));
 			gr = &temp;

File src/rect.c

View file
  • Ignore whitespace
 				{Py_XDECREF(sub); return NULL;}
 			if(!ShortFromObjIndex(sub, 0, &val)) {Py_DECREF(sub); return NULL;} temp->x = val;
 			if(!ShortFromObjIndex(sub, 1, &val)) {Py_DECREF(sub); return NULL;} temp->y = val;
+			Py_DECREF(sub);
 			sub = PySequence_GetItem(obj, 1);
 			if(!sub || !PySequence_Check(sub) || PySequence_Length(sub)!=2)
 				{Py_XDECREF(sub); return NULL;}
 			if(!ShortFromObjIndex(sub, 0, &val)) {Py_DECREF(sub); return NULL;} temp->w = val;
 			if(!ShortFromObjIndex(sub, 1, &val)) {Py_DECREF(sub); return NULL;} temp->h = val;
+			Py_DECREF(sub);
 			return temp;
 		}
 		if(PyTuple_Check(obj) && PyTuple_Size(obj) == 1) /*looks like an arg?*/