Skip to content

Commit

Permalink
Fix leaks by autoreleasing objects created with AllocObject.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160950812
  • Loading branch information
kstanger authored and tomball committed Jul 14, 2017
1 parent a38f601 commit ff14cbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jre_emul/Classes/jni.m
Expand Up @@ -537,7 +537,7 @@ static jobject AllocObject(JNIEnv *env, jclass clazz) {
|| [clazz isArray] || [clazz isEnum]) {
@throw create_JavaLangInstantiationException_initWithNSString_([clazz getName]);
}
return [clazz.objcClass alloc];
return [[clazz.objcClass alloc] autorelease];
}

static jobject NewObjectA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) {
Expand Down

0 comments on commit ff14cbc

Please sign in to comment.