Skip to content

Commit

Permalink
Reinstate the manual reference counting as discovered in #1054.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Aug 3, 2012
1 parent cbb11da commit ca678a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ft2font.cpp
Expand Up @@ -870,24 +870,28 @@ FT2Font::FT2Font(std::string facefile) :
{
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());
}

Expand All @@ -904,6 +908,7 @@ FT2Font::FT2Font(std::string facefile) :
{
std::ostringstream s;
s << "Could not set the fontsize for facefile " << facefile << std::endl;
ob_refcnt--;
throw Py::RuntimeError(s.str());
}

Expand Down

0 comments on commit ca678a4

Please sign in to comment.