OSX: handle gracefully NULL title

Bug #909 - OSX: missing NULL pointer handling

	* clutter/osx/clutter-stage-osx.c (ClutterGLWindow,
	clutter_stage_osx_set_title): NSString:stringWithUTF8String:
	does not accept NULL values, use empty string ("") instead.
	Avoids potential crash.
This commit is contained in:
Tommi Komulainen 2008-06-05 20:10:00 +00:00
parent 2d29f11cf6
commit e783591eab
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2008-06-05 Tommi Komulainen <tommi.komulainen@iki.fi>
Bug #909 - OSX: missing NULL pointer handling
* clutter/osx/clutter-stage-osx.c (ClutterGLWindow,
clutter_stage_osx_set_title): NSString:stringWithUTF8String:
does not accept NULL values, use empty string ("") instead.
Avoids potential crash.
2008-06-05 Emmanuele Bassi <ebassi@openedhand.com>
* tests/Makefile.am:

View File

@ -57,7 +57,7 @@ clutter_stage_osx_state_update (ClutterStageOSX *self,
[self setDelegate: self];
[self useOptimizedDrawing: YES];
[self setContentView: aView];
[self setTitle:[NSString stringWithUTF8String: aTitle]];
[self setTitle:[NSString stringWithUTF8String: aTitle ? aTitle : ""]];
stage = aStage;
}
return self;
@ -427,7 +427,7 @@ clutter_stage_osx_set_title (ClutterStage *stage,
CLUTTER_OSX_POOL_ALLOC();
if (CLUTTER_ACTOR_IS_REALIZED (CLUTTER_ACTOR (stage)))
[self->window setTitle:[NSString stringWithUTF8String:title]];
[self->window setTitle:[NSString stringWithUTF8String: title ? title : ""]];
CLUTTER_OSX_POOL_RELEASE();
}