Autorelease on already autorelease'd object - and return NON-mutable string from description method

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/branches/gnustep_testplant_branch@37719 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2014-02-27 22:01:29 +00:00
parent fd6955f139
commit aaa0a6e5c2

View file

@ -44,7 +44,7 @@
if (self) if (self)
{ {
// Save/set initial state... // Save/set initial state...
gsDevice = device; gsDevice = device;
_surface = NULL; _surface = NULL;
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(device, GWL_USERDATA); WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(device, GWL_USERDATA);
@ -57,7 +57,7 @@
// And deallocate ourselves... // And deallocate ourselves...
DESTROY(self); DESTROY(self);
} }
else else
{ {
// Create the cairo surfaces... // Create the cairo surfaces...
// NSBackingStoreRetained works like Buffered since 10.5 (See apple docs)... // NSBackingStoreRetained works like Buffered since 10.5 (See apple docs)...
@ -74,7 +74,7 @@
// Check for error... // Check for error...
if (cairo_surface_status(_surface) != CAIRO_STATUS_SUCCESS) if (cairo_surface_status(_surface) != CAIRO_STATUS_SUCCESS)
{ {
// Output the surface create error... // Output the surface create error...
cairo_status_t status = cairo_surface_status(_surface); cairo_status_t status = cairo_surface_status(_surface);
NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status)); NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status));
@ -87,7 +87,7 @@
// Release the device context... // Release the device context...
ReleaseDC(device, hDC); ReleaseDC(device, hDC);
} }
} }
else else
#endif #endif
@ -99,14 +99,14 @@
// Check for error... // Check for error...
if (cairo_surface_status(window) != CAIRO_STATUS_SUCCESS) if (cairo_surface_status(window) != CAIRO_STATUS_SUCCESS)
{ {
// Output the surface create error... // Output the surface create error...
cairo_status_t status = cairo_surface_status(window); cairo_status_t status = cairo_surface_status(window);
NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status)); NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status));
// And deallocate ourselves... // And deallocate ourselves...
DESTROY(self); DESTROY(self);
} }
else else
{ {
// and this is the in-memory DC surface...surface owns its DC... // and this is the in-memory DC surface...surface owns its DC...
@ -170,7 +170,7 @@
[description appendFormat: @" size: %@",NSStringFromSize([self size])]; [description appendFormat: @" size: %@",NSStringFromSize([self size])];
[description appendFormat: @" _surface: %p",_surface]; [description appendFormat: @" _surface: %p",_surface];
[description appendFormat: @" surfDC: %p",shdc]; [description appendFormat: @" surfDC: %p",shdc];
return AUTORELEASE(description); return [NSString stringWithString:description];
} }
- (NSSize) size - (NSSize) size