I don't know whether this is true of other/all STL implementations, but on iOS at least (tested on SDK 8.4 in C++98 mode), vector assignment preserves capacity if the LHS is larger than the RHS. Therefore, when an empty vector is assigned to the desired position within DashToHls_ReleaseHlsSegment(), no actual deallocation takes place. This quickly builds up to hundreds of Megabytes, and eventually iOS will kill the application for using too much memory.
Compiling in C++11 mode solves the problem (if this is a feature of C++11, it'd be nice to require C++11 compatibility); so does using std::map's erase() to remove the element.
I don't know whether this is true of other/all STL implementations, but on iOS at least (tested on SDK 8.4 in C++98 mode), vector assignment preserves capacity if the LHS is larger than the RHS. Therefore, when an empty vector is assigned to the desired position within DashToHls_ReleaseHlsSegment(), no actual deallocation takes place. This quickly builds up to hundreds of Megabytes, and eventually iOS will kill the application for using too much memory.
Compiling in C++11 mode solves the problem (if this is a feature of C++11, it'd be nice to require C++11 compatibility); so does using std::map's erase() to remove the element.