[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Winston451
Winston451 added the comment: BTW, I am really amazed by your reactivity. I submitted a bug report at 22:33 and one hour later it's fixed. It's really great! Keep up the good work! :) -- ___ Python tracker __

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Winston451
Winston451 added the comment: I was just looking at the code of the struct when i saw this problem. Personnally I have never had to reinitialize a Struct object but Python allows it so... -- ___ Python tracker __

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, you're right of course. Fixed in r83239 (py3k), r83240 (release31-maint), r83241 (release27-maint) and r83242 (release26-maint). Thanks! BTW, just out of curiosity: I don't think I've ever seen anyone re-initialize a struct.Struct object before. What

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Winston451
Winston451 added the comment: I don't think that the weakreflist should be cleared. After all the object is just reinitialized not destructed. -- ___ Python tracker ___

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Mark Dickinson
Mark Dickinson added the comment: Great! Thank you. I wonder whether the weakreflist field needs to be cleared similarly. -- ___ Python tracker ___

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Winston451
Winston451 added the comment: Hi Mark, I added a patch in the file list that should correct the bug. -- keywords: +patch Added file: http://bugs.python.org/file18263/leak.patch ___ Python tracker _

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Mark Dickinson
Mark Dickinson added the comment: Add versions. -- stage: -> needs patch versions: +Python 2.7, Python 3.1, Python 3.2 ___ Python tracker ___ ___

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the report! I'll look into this. Do you happen to have a patch available, or an interest in writing one? -- nosy: +mark.dickinson ___ Python tracker __

[issue9422] Memory leak when reinitializing a Struct object

2010-07-29 Thread Winston451
New submission from Winston451 : The s_init function of the _struct.c file does not free the s_codes field before storing a new address into it. So when a Struct object is reinitialized the memory block pointed to by s_codes is lost. The file attached with the bug report shows a code which rep