fb_generic: initialization and deinitialization fixes

* initialize variables locked and cache_size in constructor
* set lfb pointer to NULL after munmap(), fd to -1 after close
* remove unused tty fd close()
This commit is contained in:
Stefan Seyfried
2017-02-11 18:54:50 +01:00
committed by svenhoefer
parent 67387a13c6
commit 1dd47e00c0

View File

@@ -82,6 +82,7 @@ CFrameBuffer::CFrameBuffer()
fb_name = "generic framebuffer"; fb_name = "generic framebuffer";
iconBasePath = ""; iconBasePath = "";
available = 0; available = 0;
cache_size = 0;
cmap.start = 0; cmap.start = 0;
cmap.len = 256; cmap.len = 256;
cmap.red = red; cmap.red = red;
@@ -93,6 +94,7 @@ CFrameBuffer::CFrameBuffer()
background = NULL; background = NULL;
backupBackground = NULL; backupBackground = NULL;
backgroundFilename = ""; backgroundFilename = "";
locked = false;
fd = 0; fd = 0;
tty = 0; tty = 0;
m_transparent_default = CFrameBuffer::TM_BLACK; // TM_BLACK: Transparency when black content ('pseudo' transparency) m_transparent_default = CFrameBuffer::TM_BLACK; // TM_BLACK: Transparency when black content ('pseudo' transparency)
@@ -173,8 +175,6 @@ void CFrameBuffer::init(const char * const fbDevice)
goto nolfb; goto nolfb;
} }
cache_size = 0;
/* Windows Colors */ /* Windows Colors */
paletteSetColor(0x1, 0x010101, tr); paletteSetColor(0x1, 0x010101, tr);
paletteSetColor(0x2, 0x800000, tr); paletteSetColor(0x2, 0x800000, tr);
@@ -235,13 +235,14 @@ CFrameBuffer::~CFrameBuffer()
if (lfb) if (lfb)
munmap(lfb, available); munmap(lfb, available);
lfb = NULL;
if (virtual_fb){ if (virtual_fb){
delete[] virtual_fb; delete[] virtual_fb;
virtual_fb = NULL; virtual_fb = NULL;
} }
close(fd); close(fd);
close(tty); fd = -1;
v_fbarea.clear(); v_fbarea.clear();
} }