@@ -241,14 +241,18 @@ void mulle_objc_thread_done_poolconfiguration( struct _mulle_objc_universe *un
241
241
- (char *) mulleNameUTF8String
242
242
{
243
243
if ( ! _mulleNameUTF8String[ 0 ])
244
- mulle_snprintf ( _mulleNameUTF8String, sizeof ( _mulleNameUTF8String), " %p " , self);
244
+ mulle_snprintf ( _mulleNameUTF8String, sizeof ( _mulleNameUTF8String),
245
+ " <NSAutoreleasePool %p >" ,
246
+ MulleObjCInstanceGetClassNameUTF8String ( self),
247
+ self);
245
248
return ( &_mulleNameUTF8String[ 0 ]);
246
249
}
247
250
248
251
249
252
- (void ) mulleSetNameUTF8String : (char *) s
250
253
{
251
254
strncpy ( _mulleNameUTF8String, s ? s : " " , sizeof ( _mulleNameUTF8String) - 1 );
255
+ _mulleNameUTF8String[ sizeof ( _mulleNameUTF8String) - 1 ] = 0 ;
252
256
}
253
257
254
258
@@ -1181,7 +1185,10 @@ static inline void _dump_info_init( struct dump_info *p,
1181
1185
{
1182
1186
if ( thread != info->thread .mainthread )
1183
1187
{
1184
- mulle__pointermap_set ( &p->thread_index_map , thread, (void *) (intptr_t ) thread_index, NULL );
1188
+ mulle__pointermap_set ( &p->thread_index_map ,
1189
+ thread,
1190
+ (void *) (intptr_t ) thread_index,
1191
+ NULL );
1185
1192
++thread_index;
1186
1193
}
1187
1194
}
@@ -1190,6 +1197,9 @@ static inline void _dump_info_init( struct dump_info *p,
1190
1197
1191
1198
static inline void _dump_info_done ( struct dump_info *p)
1192
1199
{
1200
+ mulle_free ( p->thread_name );
1201
+ mulle_free ( p->pool_name );
1202
+
1193
1203
_mulle__pointermap_done ( &p->thread_index_map , NULL );
1194
1204
_mulle__pointermap_done ( &p->object_index_map , NULL );
1195
1205
}
@@ -1204,7 +1214,9 @@ static void _dumpinfo_dump_thread( struct dump_info *info,
1204
1214
struct _mulle_objc_poolconfiguration *config;
1205
1215
1206
1216
info->thread_adr = thread;
1207
- info->thread_name = [thread mulleNameUTF8String ];
1217
+
1218
+ mulle_free ( info->thread_name );
1219
+ info->thread_name = mulle_strdup ( [thread mulleNameUTF8String ]);
1208
1220
info->thread_index = (int ) index ;
1209
1221
info->pool_index = 0 ;
1210
1222
@@ -1214,7 +1226,8 @@ static void _dumpinfo_dump_thread( struct dump_info *info,
1214
1226
1215
1227
for ( pool = config->tail ; pool; pool = pool->_owner )
1216
1228
{
1217
- info->pool_name = [pool mulleNameUTF8String ];
1229
+ mulle_free ( info->pool_name );
1230
+ info->pool_name = mulle_strdup ( [pool mulleNameUTF8String ]);
1218
1231
info->pool_adr = pool;
1219
1232
1220
1233
--info->pool_index ;
@@ -1250,7 +1263,11 @@ static void _dumpinfo_dump_thread( struct dump_info *info,
1250
1263
_dump_info_done ( &dump_info);
1251
1264
}
1252
1265
1253
-
1266
+ //
1267
+ // Though we do a "lock" its just to block another
1268
+ // MulleObjCDumpAutoreleasePoolsToFILEWithOptions, dumping other threads
1269
+ // autoreleasepools is obviously risky.
1270
+ //
1254
1271
void MulleObjCDumpAutoreleasePoolsToFILEWithOptions ( FILE *fp, int options)
1255
1272
{
1256
1273
struct _mulle_objc_universe *universe;
0 commit comments