public void Dispose()
        {
            if (shutdownKernel_ != null)
            {
                _Extend.ResetDependencyProperties();

                System.GC.Collect();
                System.GC.WaitForPendingFinalizers();

                _Extend.Initialized(false);

                shutdownKernel_();

                _Extend.UnregisterCallbacks();

                UnregisterFunctions();
                Error.UnregisterFunctions();
                Log.UnregisterFunctions();
                _Extend.UnregisterFunctions();
                _NoesisGUI_PINVOKE.UnregisterFunctions();

                library_.Dispose();
            }

            System.GC.SuppressFinalize(this);
        }