I don't think maxdict is the problem though it may be changing how the 
problem manifests itself.  What is happening is that when maxdict is 
used, those C++ extension objects are deleted after the first 50 math 
expressions.  When using a dict, they aren't deleted until closing the 
application, so it just delays the problem.

All that said, I'm not sure as to the real cause of the error.

I was able to reproduce it on Windows XP with:

    mpl 0.98.5, wx 2.8.10.6, python 2.5.4

however, the following seems to work:

    mpl 0.98.5, wx 2.8.10.6, python 2.6.3

Are you able to update to Python 2.6?  That might be one solution to the 
problem.

I have to say I'm completely stumped as to the root cause of this one.

Mike

On 10/17/2009 08:44 AM, Cédrick FAURY wrote:
> Hello,
>
> I restate the problem :
>
> With the attached script "test_mathtext_wx.py" :
> 50 functions (line 31) : the 50 bitmaps are generated correctly, by 
> when I close the application an error appears in the console :
>
> Assertion failed: ob_refcnt == 0, file CXX\cxx_extensions.cxx, line 1128
> This application has requested the Runtime to terminate it in an 
> unusual way.
> Please contact the application's support team for more information.
>
> 250 functions : the window never appears and the crash occurs (same 
> message)
>
>
> However, if in mathtext.py (mpl 0.98.5 win32 py2.5) line 2765 in 
> MathTextParser, I put "self._cache = dict()"  instead of "self._cache 
> = maxdict(50)", the behavior of "test_mathtext_wx.py" is significantly 
> different.
> 50 functions : error on console after closing the application (no 
> difference here)
> 250 functions : NO CRASH (but error after closing the application)
>
> And now, my questions :
> Is this proof that "maxdict" is the cause of the problem ?
> Is there a known way to avoid the problem?
> Can someone tell me more about maxdict ?
>
> Hoping to have been quite clear,
> Cédrick
>
>
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to