Skip to content

Commit

Permalink
Warn(): Fixed crash when it raises an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
snej committed Jun 29, 2015
1 parent 16774ab commit a303a19
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Logging.m
Expand Up @@ -250,11 +250,16 @@ void Warn( NSString *msg, ... )
#else
_Logv(kWarningPrefix,msg,args);
#endif
if (gMYWarnRaisesException)
va_end(args);

if (gMYWarnRaisesException) {
va_list args;
va_start(args,msg);
[NSException raise: NSInternalInconsistencyException
format: [@"Warn() was called: " stringByAppendingString: msg]
arguments: args];
va_end(args);
va_end(args);
}
}


Expand Down

0 comments on commit a303a19

Please sign in to comment.