Resets the entire uCalc library to its initial startup state, releasing all instances and clearing all definitions.
Product:
Class:
Warning
uCalc API Preview Release Notice:The uCalc engine has successfully transitioned to modern cross-platform environments.The next phase envolves some structural changes, performance optimizations, and API refinements.The API is subject to breaking changes prior to the stable release. Please evaluate the preview version thoroughly before production use.
This method does not return a value.
The static ResetAll() method is a global, application-wide function that restores the uCalc library to its pristine, out-of-the-box state. It is a powerful tool for ensuring a clean environment, particularly in testing scenarios or applications with complex, dynamic configurations.
ResetAll DoesCalling this function performs the following actions:
uCalc instance created during the application's lifetime is released, freeing all associated memory.ResetAllResetAll is the most comprehensive cleanup tool and should be used when you need to guarantee a completely fresh start. Common use cases include:
ResetAll() in the TearDown or afterEach method of a test suite to ensure that each test runs in a perfectly isolated environment, free from any state created by previous tests.ResetAll can power a "Reset to Factory Defaults" feature.ResetAll vs. Other Reset MethodsIt is crucial to choose the correct cleanup method for your needs. ResetAll is the most powerful and destructive option.
| Method | Scope | Effect |
|---|---|---|
ResetAll() | Global (Library-wide) | Destroys all uCalc instances and resets the entire library. |
| DefaultClear() | Default Instance Stack | Removes all custom default instances and resets only the original, root default instance. Other instances are unaffected. |
instance.Release() | Single Instance | Releases one specific uCalc instance and its associated resources. |
⚠️ Warning: Because ResetAll() affects the entire application, use it with care. Calling it will invalidate all existing uCalc object handles, including any that may still be in scope.
This page last modified on: