Skip to content
Browse files

[3011582] stix_fonts_demo.py assert error

When matplotlib is compiled without -DNDEBUG, we get this error on one of the example:

$ python stix_fonts_demo.py
python2.6: CXX/cxx_extensions.cxx:1320: virtual Py::PythonExtensionBase::~PythonExtensionBase(): Assertion `ob_refcnt == 0' failed.
Aborted

svn path=/trunk/matplotlib/; revision=8405
  • Loading branch information...
1 parent 97b98e3 commit b5ce84214f26c49877dcb8181bcf3091f1f574bb @mdboom mdboom committed Jun 10, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/ft2font.cpp
View
7 src/ft2font.cpp
@@ -686,25 +686,28 @@ FT2Font::FT2Font(std::string facefile) :
int error = FT_New_Face( _ft2Library, facefile.c_str(), 0, &face );
-
if (error == FT_Err_Unknown_File_Format ) {
std::ostringstream s;
s << "Could not load facefile " << facefile << "; Unknown_File_Format" << std::endl;
+ ob_refcnt--;
throw Py::RuntimeError(s.str());
}
else if (error == FT_Err_Cannot_Open_Resource) {
std::ostringstream s;
s << "Could not open facefile " << facefile << "; Cannot_Open_Resource" << std::endl;
+ ob_refcnt--;
throw Py::RuntimeError(s.str());
}
else if (error == FT_Err_Invalid_File_Format) {
std::ostringstream s;
s << "Could not open facefile " << facefile << "; Invalid_File_Format" << std::endl;
+ ob_refcnt--;
throw Py::RuntimeError(s.str());
}
else if (error) {
std::ostringstream s;
s << "Could not open facefile " << facefile << "; freetype error code " << error<< std::endl;
+ ob_refcnt--;
throw Py::RuntimeError(s.str());
}
@@ -720,6 +723,7 @@ FT2Font::FT2Font(std::string facefile) :
if (error) {
std::ostringstream s;
s << "Could not set the fontsize for facefile " << facefile << std::endl;
+ ob_refcnt--;
throw Py::RuntimeError(s.str());
}
@@ -739,7 +743,6 @@ FT2Font::FT2Font(std::string facefile) :
if ( style_name == NULL )
style_name = "UNAVAILABLE";
-
setattr("postscript_name", Py::String(ps_name));
setattr("num_faces", Py::Int(face->num_faces));
setattr("family_name", Py::String(family_name));

0 comments on commit b5ce842

Please sign in to comment.
Something went wrong with that request. Please try again.