Hi all,

if I get it correctly, there's a bug in WDialog.C CTOR, not
initializing the result_ member variable, neither in the initialization
list, nor in the CTOR body.

In my wt application, it sometimes got 1 (Wt::WDialog::Accepted) within
its creation and calling result() on it gave the 1 back even if no user
interaction had still happened.

A patch like the one attached fixes it.
Hope this helps.

Bye,
-- 
Antonio
diff -uNr wt-3.1.8/src/Wt/WDialog wt-3.1.8-fixDialog/src/Wt/WDialog
--- wt-3.1.8/src/Wt/WDialog	2010-10-29 08:53:03.000000000 +0200
+++ wt-3.1.8-fixDialog/src/Wt/WDialog	2011-04-18 17:06:09.100040274 +0200
@@ -109,7 +109,8 @@
 public:
   /*! \brief The result of a modal dialog execution.
    */
-  enum DialogCode { Rejected, //!< Dialog closed with reject()
+  enum DialogCode { NotReady, //!< Dialog not closed yet
+		    Rejected, //!< Dialog closed with reject()
 		    Accepted  //!< Dialog closed with accept()
   };
 
diff -uNr wt-3.1.8/src/Wt/WDialog.C wt-3.1.8-fixDialog/src/Wt/WDialog.C
--- wt-3.1.8/src/Wt/WDialog.C	2011-02-02 12:45:42.000000000 +0100
+++ wt-3.1.8-fixDialog/src/Wt/WDialog.C	2011-04-18 17:14:30.890094648 +0200
@@ -27,6 +27,7 @@
 WDialog::WDialog(const WString& windowTitle)
   : modal_(true),
     finished_(this),
+    result_(NotReady),
     recursiveEventLoop_(false)
 { 
   const char *TEMPLATE =
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to