diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2014-08-23 12:12:05 +0200 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2014-08-23 12:16:53 +0200 |
commit | 9e8b930b136b5e6b74aea92863dc9fb2dfd97e9f (patch) | |
tree | aa357c8c7fe8f9c1465dbc8017e5cc6c3a719c44 /wizards | |
parent | writerfilter: remove mce token generator (diff) | |
download | core-9e8b930b136b5e6b74aea92863dc9fb2dfd97e9f.tar.gz core-9e8b930b136b5e6b74aea92863dc9fb2dfd97e9f.zip |
Dispose() method for all objects
An implicit (Terminate_Class) and an explicit (Dispose) method have been created
to stimulate better memory management.
Change-Id: I240e5117db6bf0d1fcf268e3ddf6d67e0bc1b8eb
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/access2base/Application.xba | 3 | ||||
-rw-r--r-- | wizards/source/access2base/Collect.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/Control.xba | 14 | ||||
-rw-r--r-- | wizards/source/access2base/DataDef.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/Database.xba | 22 | ||||
-rw-r--r-- | wizards/source/access2base/Dialog.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/Event.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/Field.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/Form.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/OptionGroup.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/Property.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/Recordset.xba | 3 | ||||
-rw-r--r-- | wizards/source/access2base/SubForm.xba | 10 | ||||
-rw-r--r-- | wizards/source/access2base/acConstants.xba | 2 |
14 files changed, 115 insertions, 19 deletions
diff --git a/wizards/source/access2base/Application.xba b/wizards/source/access2base/Application.xba index f68ced5d862a..9a994b117aae 100644 --- a/wizards/source/access2base/Application.xba +++ b/wizards/source/access2base/Application.xba @@ -1094,7 +1094,6 @@ Dim i As Integer, iCount As Integer, iAllCount As Integer, ofForm As Variant iAllCount = AllForms._Count iCount = 0 If iAllCount > 0 Then - Set ofForm = New Form For i = 0 To iAllCount - 1 Set ofForm = Application.AllForms(i) If ofForm.IsLoaded Then iCount = iCount + 1 @@ -1108,7 +1107,7 @@ Dim i As Integer, iCount As Integer, iAllCount As Integer, ofForm As Variant End If If IsMissing(piCountMax) Then _CountOpenForms = iCount - + End Function ' CountOpenForms V1.1.0 REM ----------------------------------------------------------------------------------------------------------------------- diff --git a/wizards/source/access2base/Collect.xba b/wizards/source/access2base/Collect.xba index 96da04d6f7ed..34feab0236c3 100644 --- a/wizards/source/access2base/Collect.xba +++ b/wizards/source/access2base/Collect.xba @@ -36,7 +36,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/Control.xba b/wizards/source/access2base/Control.xba index 1d54b01c670d..4f4244e56057 100644 --- a/wizards/source/access2base/Control.xba +++ b/wizards/source/access2base/Control.xba @@ -40,8 +40,8 @@ Private Sub Class_Initialize() _Shortcut = "" _Name = "" Set _FormComponent = Nothing - _DocEntry = -1 - _DbEntry = -1 + _DocEntry = -1 + _DbEntry = -1 _SubType = "" Set ControlModel = Nothing Set ControlView = Nothing @@ -51,7 +51,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/DataDef.xba b/wizards/source/access2base/DataDef.xba index 061a7c79232b..874428ad3fb8 100644 --- a/wizards/source/access2base/DataDef.xba +++ b/wizards/source/access2base/DataDef.xba @@ -40,7 +40,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/Database.xba b/wizards/source/access2base/Database.xba index cbfec7095d12..c5576f9cfa15 100644 --- a/wizards/source/access2base/Database.xba +++ b/wizards/source/access2base/Database.xba @@ -48,7 +48,24 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + If _DbConnect = DBCONNECTANY Then + If Not IsNull(Connection) Then + Connection.close() + Connection.dispose() + Set Connection = Nothing + End If + End If + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor + + REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- @@ -64,7 +81,7 @@ REM ---------------------------------------------------------------------------- REM ----------------------------------------------------------------------------------------------------------------------- Public Function mClose() As Variant -' Close the form +' Close the database If _ErrorHandler() Then On Local Error Goto Error_Function Const cstThisSub = "Database.Close" @@ -74,6 +91,7 @@ Const cstThisSub = "Database.Close" Connection.close() Connection.dispose() + Set Connection = Nothing mClose = True Exit_Function: diff --git a/wizards/source/access2base/Dialog.xba b/wizards/source/access2base/Dialog.xba index 4d8bd03a0da1..3e6fbd70aa00 100644 --- a/wizards/source/access2base/Dialog.xba +++ b/wizards/source/access2base/Dialog.xba @@ -31,7 +31,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/Event.xba b/wizards/source/access2base/Event.xba index 0f3ed4bc8945..73bcd8222546 100644 --- a/wizards/source/access2base/Event.xba +++ b/wizards/source/access2base/Event.xba @@ -66,7 +66,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/Field.xba b/wizards/source/access2base/Field.xba index 871133f2eba6..9c9ac727fccc 100644 --- a/wizards/source/access2base/Field.xba +++ b/wizards/source/access2base/Field.xba @@ -35,7 +35,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/Form.xba b/wizards/source/access2base/Form.xba index 1a292957905c..039551e142ca 100644 --- a/wizards/source/access2base/Form.xba +++ b/wizards/source/access2base/Form.xba @@ -44,7 +44,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/OptionGroup.xba b/wizards/source/access2base/OptionGroup.xba index ab0993d2ec17..7b8e4a78503c 100644 --- a/wizards/source/access2base/OptionGroup.xba +++ b/wizards/source/access2base/OptionGroup.xba @@ -40,7 +40,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/Property.xba b/wizards/source/access2base/Property.xba index 76df18094982..659c4215c85a 100644 --- a/wizards/source/access2base/Property.xba +++ b/wizards/source/access2base/Property.xba @@ -29,7 +29,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/Recordset.xba b/wizards/source/access2base/Recordset.xba index 1a25e36411fe..144a9f440561 100644 --- a/wizards/source/access2base/Recordset.xba +++ b/wizards/source/access2base/Recordset.xba @@ -61,9 +61,8 @@ End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- Private Sub Class_Terminate() + On Local Error Resume Next mClose() - Set Statement = Nothing - Set RowSet = Nothing End Sub REM ----------------------------------------------------------------------------------------------------------------------- diff --git a/wizards/source/access2base/SubForm.xba b/wizards/source/access2base/SubForm.xba index 0f8b164a0bb3..e42c53e19fdc 100644 --- a/wizards/source/access2base/SubForm.xba +++ b/wizards/source/access2base/SubForm.xba @@ -38,7 +38,15 @@ Private Sub Class_Initialize() End Sub ' Constructor REM ----------------------------------------------------------------------------------------------------------------------- -'Private Sub Class_Terminate() +Private Sub Class_Terminate() + On Local Error Resume Next + Call Class_Initialize() +End Sub ' Destructor + +REM ----------------------------------------------------------------------------------------------------------------------- +Public Sub Dispose() + Call Class_Terminate() +End Sub ' Explicit destructor REM ----------------------------------------------------------------------------------------------------------------------- REM --- CLASS GET/LET/SET PROPERTIES --- diff --git a/wizards/source/access2base/acConstants.xba b/wizards/source/access2base/acConstants.xba index c5849ffc19bd..d8b16c58e351 100644 --- a/wizards/source/access2base/acConstants.xba +++ b/wizards/source/access2base/acConstants.xba @@ -8,7 +8,7 @@ REM ============================================================================ Option Explicit REM Access2Base ----------------------------------------------------- -Global Const Access2Base_Version = "1.1.0c" +Global Const Access2Base_Version = "1.1.0d" REM AcCloseSave REM ----------------------------------------------------------------- |