Permalink
Browse files

fixed App set_video_mode so it doesn't call DESTROY

  • Loading branch information...
1 parent 6598ad1 commit 01bc3e50d397253c1ae99f445a97126f86c054f8 @Blaizer Blaizer committed Apr 8, 2012
Showing with 0 additions and 6 deletions.
  1. +0 −6 lib/SDLx/App.pm
View
6 lib/SDLx/App.pm
@@ -172,18 +172,12 @@ sub new {
sub set_video_mode {
my ( $self, $w, $h, $d, $f ) = @_;
-
my $surface = SDL::Video::set_video_mode( $w, $h, $d, $f )
or Carp::confess( "set_video_mode failed: ", SDL::get_error() );
$surface = SDLx::Surface->new( surface => $surface );
# if we already have an app
if( ref $self ) {
- # make the app scalar ref point to the new C surface object
- # luckily, we keep the app's SDLx::Controller like this
- # because its inside-out-ness pays attention to the address of the SV and not the C object
- bless $surface, ref $self;
- $$self = $$surface;
return $self;
}
return bless $surface, $self;

0 comments on commit 01bc3e5

Please sign in to comment.