shogun-toolbox/shogun — pull request #1449 by tklein23 (2013-08-21 13:34:27+00:00)
Title: Refactoring of StreamingSparseFeatures: Removed members current_vector/_length

* Removed code duplication; simpler initialization.
* Using non-refcounted sparse vector to avoid double-frees when using get_vector().

The main point of this PR is that ```get_vector()``` returned a ref-counted SparseVector, which tries to free its feature array on destructing. But this was giving memory corruptions/double frees, since the memory still belongs to the parser object. The only work-around was to set ```vector.features = NULL```.

```get_vector()``` now returns a non-ref-counted vector, which does not call ```SG_FREE(features)``` upon destruction. We're still giving away "internal" memory, but this means still no copying of ```features``` neccessary.