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_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
AM_LDFLAGS = -L$(top_builddir)/src/.libs -lfinal
|
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
|
hello_SOURCES = hello.cpp
|
||||||
dialog_SOURCES = dialog.cpp
|
dialog_SOURCES = dialog.cpp
|
||||||
input_dialog_SOURCES = input-dialog.cpp
|
input_dialog_SOURCES = input-dialog.cpp
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _INCLUDE_FINAL_FCONFIG_H
|
#ifndef _INCLUDE_FINAL_FCONFIG_H
|
||||||
#define _INCLUDE_FINAL_FCONFIG_H 1
|
#define _INCLUDE_FINAL_FCONFIG_H 1
|
||||||
|
|
||||||
/* include/final/fconfig.h. Generated automatically at end of configure. */
|
/* include/final/fconfig.h. Generated automatically at end of configure. */
|
||||||
/* config.h. Generated from config.h.in by configure. */
|
/* config.h. Generated from config.h.in by configure. */
|
||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
@ -171,6 +171,6 @@
|
||||||
#ifndef F_VERSION
|
#ifndef F_VERSION
|
||||||
#define F_VERSION "0.3.0"
|
#define F_VERSION "0.3.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* once: _INCLUDE_FINAL_FCONFIG_H */
|
/* once: _INCLUDE_FINAL_FCONFIG_H */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -416,25 +416,23 @@ void FMenuBar::onMouseMove (FMouseEvent* ev)
|
||||||
if ( menu->getCount() > 0
|
if ( menu->getCount() > 0
|
||||||
&& menu_geometry.contains(ev->getTermPos()) )
|
&& menu_geometry.contains(ev->getTermPos()) )
|
||||||
{
|
{
|
||||||
FMouseEvent* _ev;
|
|
||||||
const FPoint& t = ev->getTermPos();
|
const FPoint& t = ev->getTermPos();
|
||||||
const FPoint& p = menu->termToWidgetPos(t);
|
const FPoint& p = menu->termToWidgetPos(t);
|
||||||
int b = ev->getButton();
|
int b = ev->getButton();
|
||||||
|
|
||||||
try
|
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)
|
catch (const std::bad_alloc& ex)
|
||||||
{
|
{
|
||||||
std::cerr << "not enough memory to alloc "
|
std::cerr << "not enough memory to alloc "
|
||||||
<< ex.what() << std::endl;
|
<< ex.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->mouse_down = true;
|
|
||||||
setClickedWidget(menu);
|
|
||||||
menu->onMouseMove(_ev);
|
|
||||||
delete _ev;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue