Commit 50754cda authored by Barry Warsaw's avatar Barry Warsaw

INITMODULE(): Be sure to decref the $Revision$ string added to the

module dictionary under the "__version__" key.  Plugs a small memory
leak caught by Insure.
parent 4858c98e
...@@ -341,7 +341,7 @@ static char BTree_module_documentation[] = ...@@ -341,7 +341,7 @@ static char BTree_module_documentation[] =
"\n" "\n"
MASTER_ID MASTER_ID
BTREEITEMSTEMPLATE_C BTREEITEMSTEMPLATE_C
"$Id: BTreeModuleTemplate.c,v 1.13 2001/06/20 19:32:55 matt Exp $\n" "$Id: BTreeModuleTemplate.c,v 1.14 2001/11/08 16:52:01 bwarsaw Exp $\n"
BTREETEMPLATE_C BTREETEMPLATE_C
BUCKETTEMPLATE_C BUCKETTEMPLATE_C
KEYMACROS_H KEYMACROS_H
...@@ -356,7 +356,7 @@ BTREEITEMSTEMPLATE_C ...@@ -356,7 +356,7 @@ BTREEITEMSTEMPLATE_C
void void
INITMODULE (void) INITMODULE (void)
{ {
PyObject *m, *d, *c; PyObject *m, *d, *c, *s;
UNLESS (sort_str=PyString_FromString("sort")) return; UNLESS (sort_str=PyString_FromString("sort")) return;
UNLESS (reverse_str=PyString_FromString("reverse")) return; UNLESS (reverse_str=PyString_FromString("reverse")) return;
...@@ -426,8 +426,9 @@ INITMODULE (void) ...@@ -426,8 +426,9 @@ INITMODULE (void)
/* Add some symbolic constants to the module */ /* Add some symbolic constants to the module */
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
PyDict_SetItemString(d, "__version__", s = PyString_FromString("$Revision: 1.14 $");
PyString_FromString("$Revision: 1.13 $")); PyDict_SetItemString(d, "__version__", s);
Py_XDECREF(s);
PyExtensionClass_Export(d,MOD_NAME_PREFIX "Bucket", BucketType); PyExtensionClass_Export(d,MOD_NAME_PREFIX "Bucket", BucketType);
PyExtensionClass_Export(d,MOD_NAME_PREFIX "BTree", BTreeType); PyExtensionClass_Export(d,MOD_NAME_PREFIX "BTree", BTreeType);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment