http://bugs.openzim.org/show_bug.cgi?id=22
Summary: crash on opening zim file Product: openZIM Version: unspecified Platform: All OS/Version: All Status: NEW Severity: blocker Priority: P5 Component: zimlib AssignedTo: tommi@tntnet.org ReportedBy: cip@gmx.at CC: dev-l@openzim.org Estimated Hours: 0.0
Created an attachment (id=7) --> (http://bugs.openzim.org/attachment.cgi?id=7) ifstream constructor fix
Opening a zim file leads to a crash in the ifstream constructor. The problem is appearantly that the constructor calls the base class constructor with the member myStreambuf as an argument, before myStreambuf is initialized.
Tested on symbian, but I'd expect that this ia a problem on other platforms as well.
Attached a patch which uses the Boost Base from member idiom (see also http://www.boost.org/doc/libs/1_42_0/libs/utility/base_from_member.html) to solve this issue.