summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-07 02:37:24 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-07 02:37:24 +0000
commit0b2c0db2325107b2dd0ec6b50b1664c7a27532b6 (patch)
treea5be0c4ae8f320770a91a9ff55422e1d781c899d
parente74af6c45d89859148b79d3d48d918e66ae0e5f3 (diff)
downloadnuttx-0b2c0db2325107b2dd0ec6b50b1664c7a27532b6.tar.gz
nuttx-0b2c0db2325107b2dd0ec6b50b1664c7a27532b6.tar.bz2
nuttx-0b2c0db2325107b2dd0ec6b50b1664c7a27532b6.zip
Fix uninitialized pointer in CNxTKWindow
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4706 42af7a65-404d-4744-a932-0658087f49c3
-rwxr-xr-xNxWidgets/ChangeLog.txt4
-rw-r--r--NxWidgets/libnxwidgets/src/cnxtkwindow.cxx13
-rw-r--r--nuttx/graphics/nxtk/nxtk_opentoolbar.c2
3 files changed, 15 insertions, 4 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt
index 1d4c69c9e..cff96bca0 100755
--- a/NxWidgets/ChangeLog.txt
+++ b/NxWidgets/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/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx b/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx
index 520896fa2..8b880a618 100644
--- a/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx
+++ b/NxWidgets/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<INxWindow*>(this));
diff --git a/nuttx/graphics/nxtk/nxtk_opentoolbar.c b/nuttx/graphics/nxtk/nxtk_opentoolbar.c
index 0bcc02fa8..56ca941b8 100644
--- a/nuttx/graphics/nxtk/nxtk_opentoolbar.c
+++ b/nuttx/graphics/nxtk/nxtk_opentoolbar.c
@@ -115,7 +115,7 @@ int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height,
nxtk_setsubwindows(fwnd);
/* Then redraw the entire window, even the client window must be
- * redraw because it has changed its vertical position and size.
+ * redrawn because it has changed its vertical position and size.
*/
nxfe_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds);