diff --git a/BeefLibs/Beefy2D/src/gfx/Font.bf b/BeefLibs/Beefy2D/src/gfx/Font.bf index 70c6cf44..9771f020 100644 --- a/BeefLibs/Beefy2D/src/gfx/Font.bf +++ b/BeefLibs/Beefy2D/src/gfx/Font.bf @@ -53,8 +53,8 @@ namespace Beefy.gfx [CallingConvention(.Stdcall), CLink] static extern int32 FTFont_GetKerning(FTFont* font, int32 char8CodeA, int32 char8CodeB); - static Dictionary sFontNameMap ~ DeleteDictionaryAndKeysAndItems!(_); - static Dictionary sFontFailMap ~ DeleteDictionaryAndKeysAndItems!(_); + static Dictionary sFontNameMap ~ DeleteDictionaryAndKeysAndValues!(_); + static Dictionary sFontFailMap ~ DeleteDictionaryAndKeysAndValues!(_); static Monitor sMonitor = new .() ~ delete _; struct FTFont @@ -201,7 +201,7 @@ namespace Beefy.gfx { using (sMonitor.Enter()) { - DeleteDictionaryAndKeysAndItems!(sFontNameMap); + DeleteDictionaryAndKeysAndValues!(sFontNameMap); sFontNameMap = null; } } diff --git a/BeefLibs/corlib/src/Diagnostics/ProcessStartInfo.bf b/BeefLibs/corlib/src/Diagnostics/ProcessStartInfo.bf index 5f05473a..4a267466 100644 --- a/BeefLibs/corlib/src/Diagnostics/ProcessStartInfo.bf +++ b/BeefLibs/corlib/src/Diagnostics/ProcessStartInfo.bf @@ -19,7 +19,7 @@ namespace System.Diagnostics String mDirectory = new String() ~ delete _; String mVerb = new String("Open") ~ delete _; - public Dictionary mEnvironmentVariables ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mEnvironmentVariables ~ DeleteDictionaryAndKeysAndValues!(_); public bool UseShellExecute { get { return mUseShellExecute; } set { mUseShellExecute = value; } }; public bool RedirectStandardInput { get { return mRedirectStandardInput; } set { mRedirectStandardInput = value; } }; diff --git a/BeefLibs/corlib/src/PropertyBag.bf b/BeefLibs/corlib/src/PropertyBag.bf index f9864082..8125987c 100644 --- a/BeefLibs/corlib/src/PropertyBag.bf +++ b/BeefLibs/corlib/src/PropertyBag.bf @@ -4,7 +4,7 @@ namespace System { class PropertyBag { - public Dictionary mProperties ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mProperties ~ DeleteDictionaryAndKeysAndValues!(_); public void Add(String key, T value) where T : struct { diff --git a/BeefLibs/corlib/src/System.bf b/BeefLibs/corlib/src/System.bf index 53a2731b..def9c456 100644 --- a/BeefLibs/corlib/src/System.bf +++ b/BeefLibs/corlib/src/System.bf @@ -153,7 +153,7 @@ static } [NoShow] - [Obsolete("This mixin has been replaced by ClearAndDeleteItems", false)] + [Obsolete("Replaced by ClearAndDeleteItems", false)] public static mixin DeleteAndClearItems(var container) { for (var value in container) @@ -187,7 +187,7 @@ static } } - public static mixin DeleteDictionaryAndItems(var container) + public static mixin DeleteDictionaryAndValues(var container) { if (container != null) { @@ -199,6 +199,8 @@ static } } + [NoShow] + [Obsolete("Replaced by DeleteDictionaryAndKeysAndValues", false)] public static mixin DeleteDictionaryAndKeysAndItems(var container) { if (container != null) @@ -212,6 +214,19 @@ static } } + public static mixin DeleteDictionaryAndKeysAndValues(var container) + { + if (container != null) + { + for (var value in container) + { + delete value.key; + delete value.value; + } + delete container; + } + } + public static mixin DeleteAndNullify(var val) { delete val; diff --git a/BeefLibs/corlib/src/TimeZoneInfo.bf b/BeefLibs/corlib/src/TimeZoneInfo.bf index 46a0ad87..e3aa87ac 100644 --- a/BeefLibs/corlib/src/TimeZoneInfo.bf +++ b/BeefLibs/corlib/src/TimeZoneInfo.bf @@ -224,7 +224,7 @@ namespace System { } #if FEATURE_WIN32_REGISTRY - public Dictionary m_systemTimeZones ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary m_systemTimeZones ~ DeleteDictionaryAndKeysAndValues!(_); //public ReadOnlyCollection m_readOnlySystemTimeZones; public bool m_allSystemTimeZonesRead; diff --git a/IDE/src/CompositeFile.bf b/IDE/src/CompositeFile.bf index 5b9288ca..94edf9d1 100644 --- a/IDE/src/CompositeFile.bf +++ b/IDE/src/CompositeFile.bf @@ -14,7 +14,7 @@ namespace IDE public Monitor mMonitor = new .() ~ delete _; static String sVersionStr = "///@singleFileVersion "; static String sSectionStr = "///@embed "; - public Dictionary mData = new .() ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mData = new .() ~ DeleteDictionaryAndKeysAndValues!(_); public String mFilePath ~ delete _; public bool mPendingSave; public bool mHasChanges; diff --git a/IDE/src/FileWatcher.bf b/IDE/src/FileWatcher.bf index 4b1e89b3..90aaf15f 100644 --- a/IDE/src/FileWatcher.bf +++ b/IDE/src/FileWatcher.bf @@ -52,7 +52,7 @@ namespace IDE // One watcher per directory public static int32 sDbgFileCreateDelay; Dictionary mWatchers = new Dictionary(); - Dictionary mWatchedFiles = new Dictionary() ~ DeleteDictionaryAndKeysAndItems!(_); // Including ref count + Dictionary mWatchedFiles = new Dictionary() ~ DeleteDictionaryAndKeysAndValues!(_); // Including ref count List mChangeList = new .() ~ DeleteContainerAndItems!(_); Dictionary mChangeMap = new .() ~ delete _; List mDependencyChangeList = new List() ~ delete _; diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index d3af5706..22c3c9a2 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -446,7 +446,7 @@ namespace IDE public String mFileName ~ delete _; public String mArgs ~ delete _; public String mWorkingDir ~ delete _; - public Dictionary mEnvVars ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mEnvVars ~ DeleteDictionaryAndKeysAndValues!(_); public ArgsFileKind mUseArgsFile; public int32 mParallelGroup = -1; public bool mIsTargetRun; diff --git a/IDE/src/Project.bf b/IDE/src/Project.bf index 0a09ac4e..9d155039 100644 --- a/IDE/src/Project.bf +++ b/IDE/src/Project.bf @@ -1253,7 +1253,7 @@ namespace IDE public class Config { - public Dictionary mPlatforms = new Dictionary() ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mPlatforms = new Dictionary() ~ DeleteDictionaryAndKeysAndValues!(_); } public class Dependency @@ -1284,7 +1284,7 @@ namespace IDE public int32 mCurResVer; public int32 mLastGeneratedResVer; - public Dictionary mConfigs = new Dictionary() ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mConfigs = new Dictionary() ~ DeleteDictionaryAndKeysAndValues!(_); public GeneralOptions mGeneralOptions = new GeneralOptions() ~ delete _; public BeefGlobalOptions mBeefGlobalOptions = new BeefGlobalOptions() ~ delete _; @@ -1913,7 +1913,7 @@ namespace IDE } } - DeleteDictionaryAndKeysAndItems!(mConfigs); + DeleteDictionaryAndKeysAndValues!(mConfigs); mConfigs = new Dictionary(); for (var configNameSV in data.Enumerate("Configs")) diff --git a/IDE/src/ScriptManager.bf b/IDE/src/ScriptManager.bf index 5912981b..0e1973f8 100644 --- a/IDE/src/ScriptManager.bf +++ b/IDE/src/ScriptManager.bf @@ -39,8 +39,8 @@ namespace IDE public Object mTargetObject; } - public Dictionary mTargets = new .() ~ DeleteDictionaryAndKeysAndItems!(_); - public Dictionary mCmds = new .() ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mTargets = new .() ~ DeleteDictionaryAndKeysAndValues!(_); + public Dictionary mCmds = new .() ~ DeleteDictionaryAndKeysAndValues!(_); } public enum CmdFlags diff --git a/IDE/src/Workspace.bf b/IDE/src/Workspace.bf index fcefec00..95b6ffff 100644 --- a/IDE/src/Workspace.bf +++ b/IDE/src/Workspace.bf @@ -314,11 +314,11 @@ namespace IDE public class Config { - public Dictionary mPlatforms = new Dictionary() ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mPlatforms = new Dictionary() ~ DeleteDictionaryAndKeysAndValues!(_); } public BeefGlobalOptions mBeefGlobalOptions = new BeefGlobalOptions() ~ delete _; - public Dictionary mConfigs = new Dictionary() ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mConfigs = new Dictionary() ~ DeleteDictionaryAndKeysAndValues!(_); public HashSet mExtraPlatforms = new .() ~ DeleteContainerAndItems!(_); public class ProjectSourceCompileInstance @@ -892,7 +892,7 @@ namespace IDE public void Deserialize(StructuredData data) { - DeleteDictionaryAndKeysAndItems!(mConfigs); + DeleteDictionaryAndKeysAndValues!(mConfigs); mConfigs = new Dictionary(); using (data.Open("Workspace")) diff --git a/IDE/src/ui/AutoComplete.bf b/IDE/src/ui/AutoComplete.bf index f64a1c4d..8876a2e5 100644 --- a/IDE/src/ui/AutoComplete.bf +++ b/IDE/src/ui/AutoComplete.bf @@ -17,7 +17,7 @@ namespace IDE.ui { public String mDocString = new String(256) ~ delete _; public String mBriefString ~ delete _; - public Dictionary mParamInfo ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mParamInfo ~ DeleteDictionaryAndKeysAndValues!(_); public String ShowDocString { diff --git a/IDE/src/ui/OpenFileInSolutionDialog.bf b/IDE/src/ui/OpenFileInSolutionDialog.bf index 3f8ee85e..0cc1b7a2 100644 --- a/IDE/src/ui/OpenFileInSolutionDialog.bf +++ b/IDE/src/ui/OpenFileInSolutionDialog.bf @@ -56,7 +56,7 @@ namespace IDE.ui delete _; }; public static int32 sCurrentMRUIndex = 1; - static Dictionary sTimeCache = new .() ~ DeleteDictionaryAndKeysAndItems!(_); + static Dictionary sTimeCache = new .() ~ DeleteDictionaryAndKeysAndValues!(_); protected EntryListView mFileList; EditWidget mEditWidget; diff --git a/IDE/src/ui/ProjectProperties.bf b/IDE/src/ui/ProjectProperties.bf index 8a01e2ba..223529da 100644 --- a/IDE/src/ui/ProjectProperties.bf +++ b/IDE/src/ui/ProjectProperties.bf @@ -38,7 +38,7 @@ namespace IDE.ui } public Project mProject; - Dictionary> mDependencyValuesMap ~ DeleteDictionaryAndKeysAndItems!(_); + Dictionary> mDependencyValuesMap ~ DeleteDictionaryAndKeysAndValues!(_); Project.Options[] mCurProjectOptions ~ delete _; float mLockFlashPct; public int32 mNewDebugSessionCountdown; diff --git a/IDE/src/ui/SourceViewPanel.bf b/IDE/src/ui/SourceViewPanel.bf index 653be32c..2284cdc4 100644 --- a/IDE/src/ui/SourceViewPanel.bf +++ b/IDE/src/ui/SourceViewPanel.bf @@ -162,7 +162,7 @@ namespace IDE.ui public String mFileName ~ delete _; public String mBackupFileName ~ delete _; // Didn't match hash public String mFoundPath ~ delete _; - public Dictionary mRemapMap = new .() ~ DeleteDictionaryAndKeysAndItems!(_); + public Dictionary mRemapMap = new .() ~ DeleteDictionaryAndKeysAndValues!(_); public ~this() {