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.
http://bugs.openzim.org/show_bug.cgi?id=22
Tommi Mäkitalo tommi@tntnet.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #1 from Tommi Mäkitalo tommi@tntnet.org 2010-05-06 00:28:12 CET --- The patch adds dependency to boost. This is not really needed. There is a protected constructor and a member in iostream, which allows to initialized the base class without a streambuf and pass the streambuf in the body of the constructor.