mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
feat: add autoreleasepool to avoid memory leaks
This commit is contained in:
parent
b3c29aab14
commit
ae87718163
@ -46,15 +46,17 @@ void free_objc_string(struct ObjCString *value) {
|
||||
}
|
||||
|
||||
struct ObjCString run_command(char* input_json) {
|
||||
@try {
|
||||
NSString *inputString = c_string_to_nsstring(input_json);
|
||||
@autoreleasepool {
|
||||
@try {
|
||||
NSString *inputString = c_string_to_nsstring(input_json);
|
||||
|
||||
// NSString *outputString = [NSString stringWithFormat:@"{\"added\": %@}", e];
|
||||
NSString *outputString = @"{\"added\": 0}";
|
||||
return nsstring_to_obj_c_string(outputString);
|
||||
} @catch (NSException *e) {
|
||||
NSString *outputString = [NSString stringWithFormat:@"Error occurred while running Objective-C command: %@", e];
|
||||
return nsstring_to_obj_c_string(outputString);
|
||||
// NSString *outputString = [NSString stringWithFormat:@"{\"added\": %@}", e];
|
||||
NSString *outputString = @"{\"added\": 0}";
|
||||
return nsstring_to_obj_c_string(outputString);
|
||||
} @catch (NSException *e) {
|
||||
NSString *outputString = [NSString stringWithFormat:@"Error occurred while running Objective-C command: %@", e];
|
||||
return nsstring_to_obj_c_string(outputString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user