Patch to fix memory leak in fetch in Python interface.

Поиск
Список
Период
Сортировка
От Stephen Robert Norris
Тема Patch to fix memory leak in fetch in Python interface.
Дата
Msg-id 1003358787.31478.1.camel@ws12
обсуждение исходный текст
Ответы Re: Patch to fix memory leak in fetch in Python interface.  (Stephen Robert Norris <srn@commsecure.com.au>)
Re: Patch to fix memory leak in fetch in Python interface.  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
This stops the interface from leaking the row tuples (and thus the
results of every fetch).

    Stephen

--- pgmodule.c    Wed Oct 17 17:07:05 2001
+++ pgmodule.c.orig    Thu Oct 18 08:39:52 2001
@@ -561,11 +561,11 @@
             }
             else
                 str = PyString_FromString(PQgetvalue(self->last_result,
self->current_row, j));
-            PyTuple_SET_ITEM(rowtuple, j, str);
+            Py_DECREF(str);
+            PyTuple_SET_ITEM(rowtuple, j, Py_None);
         }

         PyList_Append(reslist, rowtuple);
-        Py_DECREF(rowtuple);
         self->current_row++;
     }


Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bill Studenmund
Дата:
Сообщение: Packages patch
Следующее
От: Stephen Robert Norris
Дата:
Сообщение: Re: Patch to fix memory leak in fetch in Python interface.