blob: df135c201c3d3baeb5b5a283a9528e35a34e5e72 [file] [log] [blame]
#Restoring a fix to an old reference counting bug which was re-included in a recent commit. It fails stix_fonts_demo.py
# https://github.com/matplotlib/matplotlib/commit/85af0c02bf9a8ecdd0fd18eab8c9662c6b9f4302#src/ft2font.cpp (Keep just in case)
Reinstate the manual reference counting as discovered in #1054
commit ca678a49f37411b1b0e72d7d0dfa88c124b0e34b
wrt Bug #442298 by Carl Michal, "the patch in the tree is missing the fifth insertion', i.e. the 2nd. hunk
appending the 2nd hunk to bicatelli's prepared patch
bicatali@gentoo.org 08/2012
--- src/ft2font.cpp.orig 2012-08-01 17:30:33.000000000 +0100
+++ src/ft2font.cpp 2012-08-01 17:30:42.000000000 +0100
@@ -870,24 +870,28 @@
{
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());
}
@@ -904,6 +908,7 @@ inline double conv(int v)
{
std::ostringstream s;
s << "Could not set the fontsize for facefile " << facefile << std::endl;
+ ob_refcnt--;
throw Py::RuntimeError(s.str());
}