Permalink
Browse files

Reinstate the manual reference counting as discovered in #1054.

  • Loading branch information...
1 parent 797940f commit 84524ebf5b53e678bcd07a4e57118f28ecec8f3b @mdboom mdboom committed Aug 3, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/ft2font.cpp
View
@@ -852,24 +852,28 @@ FT2Font::FT2Font(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds)
{
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());
}
@@ -887,6 +891,7 @@ FT2Font::FT2Font(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds)
{
std::ostringstream s;
s << "Could not set the fontsize for facefile " << facefile << std::endl;
+ ob_refcnt--;
throw Py::RuntimeError(s.str());
}

0 comments on commit 84524eb

Please sign in to comment.