From 7341d3b09196f49da5cd63a60a8bdf4314d9b8e1 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 26 Oct 2010 13:57:59 -0700 Subject: [PATCH] Fix a problem using uninitialized values (scroll_x/y) in jview (detected with valgrind). --- src/gui/jview.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/jview.cpp b/src/gui/jview.cpp index e0bf67008..a3f1fb79b 100644 --- a/src/gui/jview.cpp +++ b/src/gui/jview.cpp @@ -60,6 +60,8 @@ JWidget jview_new() view->hasbars = true; view->wherepos = 0; view->whereclick = 0; + view->scroll_x = 0; + view->scroll_y = 0; jwidget_add_hook(widget, JI_VIEW, view_msg_proc, view); jwidget_focusrest(widget, true); @@ -68,9 +70,6 @@ JWidget jview_new() jwidget_init_theme(widget); - view->scroll_x = -1; - view->scroll_y = -1; - return widget; }