Skip to content

Commit

Permalink
fix small memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel committed Mar 1, 2017
1 parent ab97b73 commit 65ae78f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions OMShell/OMShellGUI/oms.cpp
Expand Up @@ -968,20 +968,20 @@ void OMS::closeEvent( QCloseEvent *event )

void OMS::cut()
{
QKeyEvent* key = new QKeyEvent( QEvent::KeyPress, Qt::Key_X, Qt::ControlModifier, "x" );
((MyTextEdit*)moshEdit_)->sendKey( key );
QKeyEvent key = QKeyEvent( QEvent::KeyPress, Qt::Key_X, Qt::ControlModifier, "x" );
((MyTextEdit*)moshEdit_)->sendKey( &key );
}

void OMS::copy()
{
QKeyEvent* key = new QKeyEvent( QEvent::KeyPress, Qt::Key_C, Qt::ControlModifier, "c" );
((MyTextEdit*)moshEdit_)->sendKey( key );
QKeyEvent key = QKeyEvent( QEvent::KeyPress, Qt::Key_C, Qt::ControlModifier, "c" );
((MyTextEdit*)moshEdit_)->sendKey( &key );
}

void OMS::paste()
{
QKeyEvent* key = new QKeyEvent( QEvent::KeyPress, Qt::Key_V, Qt::ControlModifier, "v" );
((MyTextEdit*)moshEdit_)->sendKey( key );
QKeyEvent key = QKeyEvent( QEvent::KeyPress, Qt::Key_V, Qt::ControlModifier, "v" );
((MyTextEdit*)moshEdit_)->sendKey( &key );
}

QString OMS::organization = "openmodelica"; /* case-sensitive string. Don't change it. Used by ini settings file. */
Expand All @@ -999,4 +999,3 @@ QSettings* OMS::getApplicationSettings()
}
return pSettings;
}

0 comments on commit 65ae78f

Please sign in to comment.