new + delete in the same scope
This commit is contained in:
parent
28f3de0971
commit
59e8dd65c4
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue