antialize/wkhtmltopdf — pull request #22 by poizan42 (2013-07-09 14:56:06+00:00)
Title: Don't return freed memory from wkhtmltopdf_phase_description and wkhtmltopdf_progress_string

Currently the functions wkhtmltopdf_phase_description and wkhtmltopdf_progress_string returns constData() from QByteBuffers (as returned by QString::toUtf8()) which becomes invalid when the QByteBuffers goes out of scope. This can in some circumstances cause garbage data to be read, or even cause crashes.

This fixes the issue without changes to the api by creating a cache of QByteBuffers containing UTF8 representations of the strings in question. The cache is part of the app, so it is freed by wkhtmltopdf_deinit.

This fixes https://code.google.com/p/wkhtmltopdf/issues/detail?id=1086