From: Kartik Thakore Date: Sat, 8 Aug 2009 17:44:06 +0000 (-0400) Subject: Made sure that empty surfaces are not attempted to be destroyed in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9bf65e794d23c13b748fa07f904fa75f27187893;p=sdlgit%2FSDL_perl.git Made sure that empty surfaces are not attempted to be destroyed in TTFont::DESTROY(). --- diff --git a/lib/SDL/TTFont.pm b/lib/SDL/TTFont.pm index 5aab81e..d9b6e60 100644 --- a/lib/SDL/TTFont.pm +++ b/lib/SDL/TTFont.pm @@ -69,8 +69,8 @@ sub new { sub DESTROY { my $self = shift; - SDL::FreeSurface($self->{-surface}); - SDL::TTFCloseFont($self->{-font}); + SDL::FreeSurface($self->{-surface}) if (defined ($self->{-surface})); + SDL::TTFCloseFont($self->{-font}) if (defined ($self->{-font})); } sub print {