Commit e3d45d25 authored by David Edmundson's avatar David Edmundson
Browse files

Fix valgrind warning on startup

Before KSldApp's constructor we call QObject::QObject. This calls
setParent which triggers a ParentChangedEvent on the virtual from the
constructor (boo!)

At this point our constructor hasn't run, so m_globalAccel isn't
initiliased.

Arguably this is a false positive as it always evaluates to the same
thing, but we don't want to be reading uninitialised memory.
parent 13ba1c36
......@@ -771,7 +771,7 @@ void KSldApp::setGreeterEnvironment(const QProcessEnvironment &env)
bool KSldApp::event(QEvent *event)
{
if (m_globalAccel && event->type() == QEvent::KeyPress) {
if (event->type() == QEvent::KeyPress && m_globalAccel) {
if (m_globalAccel->keyEvent(static_cast<QKeyEvent*>(event))) {
event->setAccepted(true);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment