From 7431c14ba6f17574dbfae5c779596babaf1cd522 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Sun, 9 Oct 2011 21:37:52 +0200 Subject: [PATCH] don't use uninitialized variables --- src/Main/FGEventHandler.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Main/FGEventHandler.cxx b/src/Main/FGEventHandler.cxx index 950ccfd10..875da4b3f 100644 --- a/src/Main/FGEventHandler.cxx +++ b/src/Main/FGEventHandler.cxx @@ -215,11 +215,13 @@ bool FGEventHandler::handle(const osgGA::GUIEventAdapter& ea, button = 3; else if (ea.getScrollingDeltaY() < 0) button = 4; + else + button = -1; } else if (ea.getScrollingMotion() == osgGA::GUIEventAdapter::SCROLL_UP) button = 3; else button = 4; - if (mouseClickHandler) { + if (mouseClickHandler && button != -1) { (*mouseClickHandler)(button, 0, x, y, mainWindow, &ea); (*mouseClickHandler)(button, 1, x, y, mainWindow, &ea); } -- 2.39.5