Leak fix for change set 1aecdc720018 plus comment updates. r=jimm.
authorJim Mathies <jmathies@mozilla.com>
Tue, 30 Jun 2009 01:00:16 -0500
changeset 29841 9f0e541d6656a3f314c90beb99f33bb499406ecd
parent 29840 c5585029345b42925939713d568e5f14b4dec0a3
child 29842 f4d72fac17b4c46bd42b2087e8ddf41d7e434882
push idunknown
push userunknown
push dateunknown
reviewersjimm
milestone1.9.2a1pre
Leak fix for change set 1aecdc720018 plus comment updates. r=jimm.
widget/src/windows/nsWinGesture.cpp
widget/src/windows/nsWinGesture.h
widget/src/windows/nsWindow.cpp
widget/src/windows/nsWindow.h
widget/src/windows/nsWindowCE.cpp
widget/src/windows/nsWindowCE.h
widget/src/windows/nsWindowDbg.cpp
widget/src/windows/nsWindowDbg.h
widget/src/windows/nsWindowDefs.h
widget/src/windows/nsWindowGfx.cpp
widget/src/windows/nsWindowGfx.h
--- a/widget/src/windows/nsWinGesture.cpp
+++ b/widget/src/windows/nsWinGesture.cpp
@@ -31,18 +31,19 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifndef WinGesture_cpp__
-#define WinGesture_cpp__
+/*
+ * nsWinGesture - Touch input handling for tablet displays.
+ */
 
 #include "nscore.h"
 #include "nsWinGesture.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsIServiceManager.h"
 #include "nsIDOMSimpleGestureEvent.h"
 #include "nsGUIEvent.h"
@@ -592,13 +593,9 @@ nsWinGesture::PanDeltaToPixelScrollY(nsM
                       nsMouseScrollEvent::kNoLines|
                       nsMouseScrollEvent::kNoDefer;
     evt.delta = mPixelScrollDelta.y;
     evt.refPoint.x = mPanRefPoint.x;
     evt.refPoint.y = mPanRefPoint.y;
     return PR_TRUE;
   }
   return PR_FALSE;
-}
-
-#endif /* WinGesture_cpp__ */
-
-
+}
\ No newline at end of file
--- a/widget/src/windows/nsWinGesture.h
+++ b/widget/src/windows/nsWinGesture.h
@@ -34,16 +34,20 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef WinGesture_h__
 #define WinGesture_h__
 
+/*
+ * nsWinGesture - Touch input handling for tablet displays.
+ */
+
 #include "nsdefs.h"
 #include <winuser.h>
 #include "nsPoint.h"
 #include "nsGUIEvent.h"
 
 #if !defined(NTDDI_WIN7) ||  NTDDI_VERSION < NTDDI_WIN7
 
 DECLARE_HANDLE(HGESTUREINFO);
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -47,16 +47,18 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
+ * nsWindow - Native window management and event handling.
+ * 
  * nsWindow is organized into a set of major blocks and
  * block subsections. The layout is as follows:
  *
  *  Includes
  *  Variables
  *  nsIWidget impl.
  *     nsIWidget methods and utilities
  *  nsSwitchToUIThread impl.
@@ -405,36 +407,36 @@ nsWindow::~nsWindow()
   if (mCursor == -1) {
     // A successfull SetCursor call will destroy the custom cursor, if it's ours
     SetCursor(eCursor_standard);
   }
 
   sInstanceCount--;
 
   // Global shutdown
-  if (!sInstanceCount) {
+  if (sInstanceCount == 0) {
 #ifdef NS_ENABLE_TSF
     nsTextStore::Terminate();
 #endif
 
 #if !defined(WINCE)
     NS_IF_RELEASE(sCursorImgContainer);
-
     if (sIsOleInitialized) {
       ::OleFlushClipboard();
       ::OleUninitialize();
       sIsOleInitialized = FALSE;
     }
-
     // delete any of the IME structures that we allocated
     nsIMM32Handler::Terminate();
-
-    NS_IF_RELEASE(mNativeDragTarget);
 #endif // !defined(WINCE)
   }
+
+#if !defined(WINCE)
+  NS_IF_RELEASE(mNativeDragTarget);
+#endif // !defined(WINCE)
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget)
 
 /**************************************************************
  *
  * SECTION: nsIWidget::Create, nsIWidget::Destroy
  *
--- a/widget/src/windows/nsWindow.h
+++ b/widget/src/windows/nsWindow.h
@@ -40,16 +40,20 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef Window_h__
 #define Window_h__
 
+/*
+ * nsWindow - Native window management and event handling.
+ */
+
 #include "nsBaseWidget.h"
 #include "nsdefs.h"
 #include "nsSwitchToUIThread.h"
 #include "nsToolkit.h"
 #include "nsIEventListener.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "gfxWindowsSurface.h"
--- a/widget/src/windows/nsWindowCE.cpp
+++ b/widget/src/windows/nsWindowCE.cpp
@@ -30,16 +30,20 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+/*
+ * nsWindowCE - Windows CE specific code related to nsWindow. 
+ */
+
 #include "nsWindowCE.h"
 #include "nsIObserverService.h"
 #include "resource.h"
 
 /**************************************************************
  **************************************************************
  **
  ** BLOCK: Variables
--- a/widget/src/windows/nsWindowCE.h
+++ b/widget/src/windows/nsWindowCE.h
@@ -35,16 +35,20 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsWindow.h"
 
 #ifndef WindowCE_h__
 #define WindowCE_h__
 
+/*
+ * nsWindowCE - Windows CE specific code related to nsWindow. 
+ */
+
 #ifdef WINCE
 
 #include "aygshell.h"
 #include "imm.h"
 #ifdef WINCE_WINDOWS_MOBILE
 #define WINCE_HAVE_SOFTKB
 #include "tpcshell.h"
 #else
--- a/widget/src/windows/nsWindowDbg.cpp
+++ b/widget/src/windows/nsWindowDbg.cpp
@@ -31,16 +31,20 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+/*
+ * nsWindowDbg - Debug related utilities for nsWindow.
+ */
+
 #include "nsWindowDbg.h"
 
 #if defined(POPUP_ROLLUP_DEBUG_OUTPUT) || defined(EVENT_DEBUG_OUTPUT)
 
 typedef struct {
   char * mStr;
   long   mId;
 } EventMsgInfo;
--- a/widget/src/windows/nsWindowDbg.h
+++ b/widget/src/windows/nsWindowDbg.h
@@ -34,16 +34,20 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef WindowDbg_h__
 #define WindowDbg_h__
 
+/*
+ * nsWindowDbg - Debug related utilities for nsWindow.
+ */
+
 #include "nsWindowDefs.h"
 
 // Enabled main event loop debug event output
 //#define EVENT_DEBUG_OUTPUT
 
 // Enables debug output for popup rollup hooks
 //#define POPUP_ROLLUP_DEBUG_OUTPUT
 
--- a/widget/src/windows/nsWindowDefs.h
+++ b/widget/src/windows/nsWindowDefs.h
@@ -34,16 +34,20 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef WindowDefs_h__
 #define WindowDefs_h__
 
+/*
+ * nsWindowDefs - nsWindow related definitions, consts, and macros.
+ */
+
 #include "nsBaseWidget.h"
 #include "nsdefs.h"
 #include "resource.h"
 
 /**************************************************************
  *
  * SECTION: defines
  * 
--- a/widget/src/windows/nsWindowGfx.cpp
+++ b/widget/src/windows/nsWindowGfx.cpp
@@ -30,16 +30,20 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+/*
+ * nsWindowGfx - Painting and aceleration.
+ */
+
 // XXX Future: this should really be a stand alone class stored as
 // a member of nsWindow with getters and setters for things like render
 // mode and methods for handling paint.
 
 /**************************************************************
  **************************************************************
  **
  ** BLOCK: Includes
--- a/widget/src/windows/nsWindowGfx.h
+++ b/widget/src/windows/nsWindowGfx.h
@@ -33,16 +33,20 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef WindowGfx_h__
 #define WindowGfx_h__
 
+/*
+ * nsWindowGfx - Painting and aceleration.
+ */
+
 #include "nsWindow.h"
 
 // This isn't ideal, we should figure out how to export
 // the #defines here; need this to figure out if we have
 // the DirectDraw surface or not.
 #include "cairo-features.h"
 
 #ifdef CAIRO_HAS_DDRAW_SURFACE