mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
Fix memory leak: properly release each allocated element of characterBitmaps
svn path=/trunk/KDE/kdegraphics/okular/; revision=1079217
This commit is contained in:
parent
dd912f70a0
commit
a1d64f2944
|
@ -104,6 +104,11 @@ TeXFont_PK::TeXFont_PK(TeXFontDefinition *parent)
|
|||
TeXFont_PK::~TeXFont_PK()
|
||||
{
|
||||
//@@@ Release bitmaps
|
||||
for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++)
|
||||
if (characterBitmaps[i] != 0) {
|
||||
delete characterBitmaps[i];
|
||||
characterBitmaps[i] = 0;
|
||||
}
|
||||
|
||||
if (file != 0) {
|
||||
fclose(file);
|
||||
|
|
|
@ -12,6 +12,17 @@
|
|||
#include "glyph.h"
|
||||
#include "kvs_debug.h"
|
||||
|
||||
bitmap::bitmap()
|
||||
{
|
||||
bits = 0;
|
||||
}
|
||||
|
||||
bitmap::~bitmap()
|
||||
{
|
||||
if (bits != 0) {
|
||||
delete bits;
|
||||
}
|
||||
}
|
||||
|
||||
glyph::glyph()
|
||||
{
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
|
||||
struct bitmap {
|
||||
bitmap();
|
||||
~bitmap();
|
||||
|
||||
// width and height in pixels
|
||||
quint16 w, h;
|
||||
// scan-line width in bytes
|
||||
|
|
Loading…
Reference in a new issue