new + delete in the same scope

This commit is contained in:
Markus Gans 2017-09-17 21:44:22 +02:00
parent 28f3de0971
commit 59e8dd65c4
4 changed files with 9 additions and 10 deletions

View File

@ -374,7 +374,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_LDFLAGS = -L$(top_builddir)/src/.libs -lfinal
AM_CPPFLAGS = -I../include -I$(top_srcdir)/src -Wall -Werror
AM_CPPFLAGS = -I$(top_srcdir)/include -Wall -Werror
hello_SOURCES = hello.cpp
dialog_SOURCES = dialog.cpp
input_dialog_SOURCES = input-dialog.cpp

View File

@ -416,25 +416,23 @@ void FMenuBar::onMouseMove (FMouseEvent* ev)
if ( menu->getCount() > 0
&& menu_geometry.contains(ev->getTermPos()) )
{
FMouseEvent* _ev;
const FPoint& t = ev->getTermPos();
const FPoint& p = menu->termToWidgetPos(t);
int b = ev->getButton();
try
{
_ev = new FMouseEvent (fc::MouseMove_Event, p, t, b);
FMouseEvent* _ev = new FMouseEvent (fc::MouseMove_Event, p, t, b);
menu->mouse_down = true;
setClickedWidget(menu);
menu->onMouseMove(_ev);
delete _ev;
}
catch (const std::bad_alloc& ex)
{
std::cerr << "not enough memory to alloc "
<< ex.what() << std::endl;
}
menu->mouse_down = true;
setClickedWidget(menu);
menu->onMouseMove(_ev);
delete _ev;
}
}
}

1
stamp-h1 Normal file
View File

@ -0,0 +1 @@
timestamp for config.h