From 9eaedaec1ee2dfaa1f3a21e0ed3afda7cc2cea2a Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 7 May 2012 02:37:24 +0000 Subject: [PATCH] Fix uninitialized pointer in CNxTKWindow git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4706 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 +++- libnxwidgets/src/cnxtkwindow.cxx | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1d4c69c9e..cff96bca0 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -26,4 +26,6 @@ some lesser used feature over time in order to reduce the NxWidgets footprint. * CNxWidget: Removed support for reference constants and close types. - The goal is to ge the base widget class as small as possible. \ No newline at end of file + The goal is to ge the base widget class as small as possible. +* CNxTkWindow: Fix uninitialized pointer value. + diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 520896fa2..8b880a618 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -66,9 +66,18 @@ using namespace NXWidgets; */ CNxTkWindow::CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) - : CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hNxTkWindow(0), - m_widgetControl(pWidgetControl) + : CCallback(pWidgetControl) { + // Save construction values + + m_hNxServer = hNxServer; + m_widgetControl = pWidgetControl; + + // Nullify uninitilized pointers + + m_hNxTkWindow = (NXTKWINDOW )0; + m_toolbar = (CNxToolbar *)0; + // Create the CGraphicsPort instance for this window m_widgetControl->createGraphicsPort(static_cast(this));