diff --git a/Core/BloomFilterWrapper.h b/Core/BloomFilterWrapper.h index 64d3d81da9..87c7b83717 100644 --- a/Core/BloomFilterWrapper.h +++ b/Core/BloomFilterWrapper.h @@ -21,6 +21,7 @@ @interface BloomFilterWrapper : NSObject - (instancetype)initFromPath:(NSString*)path withBitCount:(int)bitCount andTotalItems:(int)totalItems; - (instancetype)initWithTotalItems:(int)count errorRate:(double)errorRate; +- (void)dealloc; - (void)add:(NSString*) entry; - (BOOL)contains:(NSString*) entry; @end diff --git a/Core/BloomFilterWrapper.mm b/Core/BloomFilterWrapper.mm index 9427650009..3e802667b8 100644 --- a/Core/BloomFilterWrapper.mm +++ b/Core/BloomFilterWrapper.mm @@ -44,6 +44,10 @@ - (instancetype)initWithTotalItems:(int)count errorRate:(double)errorRate { return self; } +- (void)dealloc { + delete filter; +} + - (void)add:(NSString*)entry { if (filter != nil) { filter->add([entry UTF8String]);