rmsalinas / fbow

FBOW (Fast Bag of Words) is an extremmely optimized version of the DBow2/DBow3 libraries.
559 stars 141 forks source link

fixed segfault due to double delete #21

Closed jbfuehrer closed 5 years ago

jbfuehrer commented 5 years ago

...when copy-constructing fbow::Vocabulary (disregarded Rule of Three)

My application crashed in a method where I returned a generated vocabulary from a method. Apparently the default copy ctor simply copies the char pointer which got deleted twice (once in the dtor of the local vocabulary object, a second time by the returned copy). I replaced the raw pointer with a unique_ptr with a custom deleter and made the object move-only so it can be returned from methods.

reenabled distance_hamming_32bytes.

Any reason why the latter was commented out? Gives a 4x speedup for me on Win10, i7