[memory leaks] Adding model for CVPixelBufferRelease

Reviewed By: da319

Differential Revision: D6458051

fbshipit-source-id: a61ffb9
master
Dulma Churchill 7 years ago committed by Facebook Github Bot
parent 0ed1a51944
commit d25754597d

@ -0,0 +1,12 @@
/*
* Copyright (c) 2017 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <CoreVideo/CVBuffer.h>
#import <CoreVideo/CVPixelBuffer.h>
void CVPixelBufferRelease(CVPixelBufferRef pxbuffer) { __free_cf(pxbuffer); }

@ -27,6 +27,7 @@ SOURCES_DEFAULT = \
memory_leaks_benchmark/NSString_models_tests.m \
memory_leaks_benchmark/NSData_models_tests.m \
memory_leaks_benchmark/RetainReleaseExampleBucketing.m \
memory_leaks_benchmark/CoreVideoExample.m \
npe/Fraction.m \
npe/NPD_core_foundation.m \
npe/Npe_with_equal_names.m \

@ -73,6 +73,7 @@ codetoanalyze/objc/errors/subtyping/KindOfClassExample.m, shouldThrowDivideByZer
codetoanalyze/objc/errors/subtyping/KindOfClassExample.m, shouldThrowDivideByZero2, 2, DIVIDE_BY_ZERO, [start of procedure shouldThrowDivideByZero2(),start of procedure init,return from a call to Base_init,start of procedure returnsZero2(),Condition is false,return from a call to returnsZero2]
codetoanalyze/objc/errors/subtyping/KindOfClassExample.m, shouldThrowDivideByZero3, 3, DIVIDE_BY_ZERO, [start of procedure shouldThrowDivideByZero3(),start of procedure init,return from a call to Derived_init,Condition is true]
codetoanalyze/objc/errors/variadic_methods/premature_nil_termination.m, PrematureNilTermA_nilInArrayWithObjects, 5, PREMATURE_NIL_TERMINATION_ARGUMENT, [start of procedure nilInArrayWithObjects]
codetoanalyze/objc/errors/memory_leaks_benchmark/CoreVideoExample.m, CoreVideoExample_cvpixelbuffer_not_released_leak, 1, MEMORY_LEAK, [start of procedure cvpixelbuffer_not_released_leak]
codetoanalyze/objc/errors/memory_leaks_benchmark/NSData_models_tests.m, NSData_models_tests_macForIV:, 2, MEMORY_LEAK, [start of procedure macForIV:]
codetoanalyze/objc/errors/memory_leaks_benchmark/NSString_models_tests.m, StringInitA_hexStringValue, 11, MEMORY_LEAK, [start of procedure hexStringValue,Skipping CFStringCreateWithBytesNoCopy(): function or method not found,Condition is false]
codetoanalyze/objc/errors/npe/Fraction.m, test_virtual_call, 7, NULL_DEREFERENCE, [start of procedure test_virtual_call(),start of procedure setNumerator:,return from a call to Fraction_setNumerator:,start of procedure getNumerator,return from a call to Fraction_getNumerator,Condition is true]

@ -0,0 +1,29 @@
/*
* Copyright (c) 2017 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <CoreVideo/CVBuffer.h>
#import <CoreVideo/CVPixelBuffer.h>
#import <Foundation/NSObject.h>
CVPixelBufferRef MyCVPixelBufferCreate();
@interface CoreVideoExample : NSObject
@end
@implementation CoreVideoExample
- (void)cvpixelbuffer_released_no_leak {
CVPixelBufferRef pxbuffer = MyCVPixelBufferCreate();
CVPixelBufferRelease(pxbuffer);
}
- (void)cvpixelbuffer_not_released_leak {
CVPixelBufferRef pxbuffer = MyCVPixelBufferCreate();
}
@end
Loading…
Cancel
Save