@@ -812,10 +812,10 @@ static CGFloat _get_device_scale(CGContextRef cr)
812812FigureManager_set_window_title (FigureManager* self,
813813 PyObject *args, PyObject *kwds)
814814{
815- char * title;
816- if (!PyArg_ParseTuple (args, " es " , " UTF-8 " , &title))
815+ const char * title;
816+ if (!PyArg_ParseTuple (args, " s " , &title)) {
817817 return NULL ;
818-
818+ }
819819 Window* window = self->window ;
820820 if (window)
821821 {
@@ -826,7 +826,6 @@ static CGFloat _get_device_scale(CGContextRef cr)
826826 [window setTitle: ns_title];
827827 [pool release ];
828828 }
829- PyMem_Free (title);
830829 Py_RETURN_NONE;
831830}
832831
@@ -1369,18 +1368,17 @@ -(void)save_figure:(id)sender
13691368{
13701369 int result;
13711370 const char * title;
1372- char * default_filename;
1373- if (!PyArg_ParseTuple (args, " ses " , &title, " UTF-8 " , &default_filename))
1371+ const char * default_filename;
1372+ if (!PyArg_ParseTuple (args, " ss " , &title, &default_filename)) {
13741373 return NULL ;
1375-
1374+ }
13761375 NSSavePanel * panel = [NSSavePanel savePanel ];
13771376 [panel setTitle: [NSString stringWithCString: title
13781377 encoding: NSASCIIStringEncoding]];
13791378 NSString * ns_default_filename =
13801379 [[NSString alloc ]
13811380 initWithCString: default_filename
13821381 encoding: NSUTF8StringEncoding];
1383- PyMem_Free (default_filename);
13841382#ifdef COMPILING_FOR_10_6
13851383 [panel setNameFieldStringValue: ns_default_filename];
13861384 result = [panel runModal ];
0 commit comments