Deserialize BloomFilter::Native properly #17

Merged
merged 1 commit into from May 9, 2012

2 participants

@twhaples

So you can marshal a Bloomfilter::Native. That works.
And you can unmarshal it. And that succeeds.
And then you can marshal it again. And that succeeds.
But when you unmarshal it the second time, it CRASHES HORRIBLY.

It looks like you're not restoring the @opts instance variable properly, so when it's serialized the second time, it's serialized as nil. Actually, it looks like when you're unmarshalling, you set up a Bloomfilter::Native that has its @bf variable set to another Bloomfilter::Native, instead of being a normal Bloomfilter::Native like it was before... and I guess it still superficially looks like the old one because it delegates.

(I'm writing an application which takes a bloomfilter, saves it, restores it later, updates it an hour later, and saves it again.)

@igrigorik igrigorik merged commit a6b0218 into igrigorik:master May 9, 2012
@igrigorik
Owner

looks good - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment