8000 Fix reference counting bug that was causing a memory leak in test_mat… · matplotlib/matplotlib@98ee4e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 98ee4e9

Browse files
Fix reference counting bug that was causing a memory leak in test_mathtext_font_* regression tests.
This fix supported by Sage Days 29.
1 parent 05745e9 commit 98ee4e9

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/ft2font.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -674,28 +674,24 @@ FT2Font::FT2Font(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds)
674674
{
675675
std::ostringstream s;
676676
s << "Could not load facefile " << facefile << "; Unknown_File_Format" << std::endl;
677-
ob_refcnt--;
678677
throw Py::RuntimeError(s.str());
679678
}
680679
else if (error == FT_Err_Cannot_Open_Resource)
681680
{
682681
std::ostringstream s;
683682
s << "Could not open facefile " << facefile << "; Cannot_Open_Resource" << std::endl;
684-
ob_refcnt--;
685683
throw Py::RuntimeError(s.str());
686684
}
687685
else if (error == FT_Err_Invalid_File_Format)
688686
{
689687
std::ostringstream s;
690688
s << "Could not open facefile " << facefile << "; Invalid_File_Format" << std::endl;
691-
ob_refcnt--;
692689
throw Py::RuntimeError(s.str());
693690
}
694691
else if (error)
695692
{
696693
std::ostringstream s;
697694
s << "Could not open facefile " << facefile << "; freetype error code " << error << std::endl;
698-
ob_refcnt--;
699695
throw Py::RuntimeError(s.str());
700696
}
701697

@@ -712,7 +708,6 @@ FT2Font::FT2Font(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds)
712708
{
713709
std::ostringstream s;
714710
s << "Could not set the fontsize for facefile " << facefile << std::endl;
715-
ob_refcnt--;
716711
throw Py::RuntimeError(s.str());
717712
}
718713

0 commit comments

Comments
 (0)
0