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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _INCLUDE_FINAL_FCONFIG_H
|
||||
#define _INCLUDE_FINAL_FCONFIG_H 1
|
||||
|
||||
|
||||
/* include/final/fconfig.h. Generated automatically at end of configure. */
|
||||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
@ -171,6 +171,6 @@
|
|||
#ifndef F_VERSION
|
||||
#define F_VERSION "0.3.0"
|
||||
#endif
|
||||
|
||||
|
||||
/* once: _INCLUDE_FINAL_FCONFIG_H */
|
||||
#endif
|
||||
|
|
|
@ -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