From 59e8dd65c442407999e3c0d8d0415970336b01e4 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 17 Sep 2017 21:44:22 +0200 Subject: [PATCH] new + delete in the same scope --- examples/Makefile.in | 2 +- include/final/fconfig.h | 4 ++-- src/fmenubar.cpp | 12 +++++------- stamp-h1 | 1 + 4 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 stamp-h1 diff --git a/examples/Makefile.in b/examples/Makefile.in index 7e7dc49f..690572b5 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -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 diff --git a/include/final/fconfig.h b/include/final/fconfig.h index ff16c3e4..f3dc2f90 100644 --- a/include/final/fconfig.h +++ b/include/final/fconfig.h @@ -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 diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index ef128ea0..c30fd22c 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.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; } } } diff --git a/stamp-h1 b/stamp-h1 new file mode 100644 index 00000000..4547fe1b --- /dev/null +++ b/stamp-h1 @@ -0,0 +1 @@ +timestamp for config.h