Skip to content

Commit ce167a7

Browse files
committed
Add PgFont_GenerationCheck()
1 parent 0025687 commit ce167a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src_c/font.c

+8
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,10 @@ font_getter_style_name(PyObject *self, void *closure)
832832
static int
833833
font_setter_outline(PyObject *self, PyObject *value, void *closure)
834834
{
835+
if (!PgFont_GenerationCheck(self)) {
836+
return RAISE_FONT_QUIT_ERROR();
837+
}
838+
835839
TTF_Font *font = PyFont_AsFont(self);
836840
int val;
837841

@@ -846,6 +850,10 @@ font_setter_outline(PyObject *self, PyObject *value, void *closure)
846850
static PyObject *
847851
font_getter_outline(PyObject *self, void *closure)
848852
{
853+
if (!PgFont_GenerationCheck(self)) {
854+
return RAISE_FONT_QUIT_ERROR();
855+
}
856+
849857
return PyLong_FromLong(TTF_GetFontOutline(PyFont_AsFont(self)));
850858
}
851859

0 commit comments

Comments
 (0)