On Sat, Jun 13, 2009 at 8:06 PM, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sat, 13 Jun 2009 19:46:07 +0200, Arve Knudsen <<a href="mailto:arve.knudsen@gmail.com">arve.knudsen@gmail.com</a>><br>
wrote:<br>
<div><div></div><div class="h5">> Sorry to bother you again, Phil :) I think I may have stumbled onto<br>
another<br>
> SIP bug, however, as I got a crash in a debug-built Python 2.6, due to a<br>
> negative reference count for my extension module. According to the Python<br>
> documentation, objects returned from Py_InitModule are borrowed, so one<br>
> should increment their reference count. So I patched sip to do just that,<br>
> and the problem went away.<br>
<br>
</div></div>You don't need to take a reference. However Py_DECREFs in the error<br>
handling code are all wrong (they should only be done for Python v3). Are<br>
any of the error paths being executed in your case?<em></em></blockquote></div><br><br>Oh, I see your point now, and that the DECREFs shouldn't be there :) I am no longer able to reproduce the problem however :/ Anyway, if you remove those DECREFs there should be one less source of errors at least.<br>
<br>Arve<br>