Fix: Dereference of null pointer in transparent.cpp
This commit is contained in:
parent
1231b9f65d
commit
a2d69f5e7b
|
@ -105,15 +105,18 @@ void Transparent::draw()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void Transparent::onKeyPress (FKeyEvent* ev)
|
void Transparent::onKeyPress (FKeyEvent* ev)
|
||||||
{
|
{
|
||||||
if ( ev && ev->key() == 'q' && getParentWidget() )
|
if ( ev )
|
||||||
{
|
{
|
||||||
if ( getParentWidget()->close() )
|
if ( ev->key() == 'q' && getParentWidget() )
|
||||||
ev->accept();
|
{
|
||||||
|
if ( getParentWidget()->close() )
|
||||||
|
ev->accept();
|
||||||
|
else
|
||||||
|
ev->ignore();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ev->ignore();
|
FDialog::onKeyPress(ev);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
FDialog::onKeyPress(ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -144,13 +147,16 @@ class MainWindow : public FDialog
|
||||||
void onTimer (FTimerEvent*);
|
void onTimer (FTimerEvent*);
|
||||||
void onKeyPress (FKeyEvent* ev)
|
void onKeyPress (FKeyEvent* ev)
|
||||||
{
|
{
|
||||||
if ( ev && ev->key() == 'q' )
|
if ( ev )
|
||||||
{
|
{
|
||||||
close();
|
if ( ev->key() == 'q' )
|
||||||
ev->accept();
|
{
|
||||||
|
close();
|
||||||
|
ev->accept();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
FDialog::onKeyPress(ev);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
FDialog::onKeyPress(ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue