コード例 #1
0
        // ###############################################################################
        // ### D E S T R U C T I O N
        // ###############################################################################

        #region Destruction

        /// <summary> IDisposable implementation. </summary>
        public override void Dispose()
        {
            Console.WriteLine(CLASS_NAME + "::Dispose ()");

            // Memory and resources, that are assigned to underlaying Athena widget's
            // instance structure are destroyed by XtDestroyWidget ().
            // This typically inclused the GCs, pixmaps and local copies of strings.
            // They are typically assigned during XtCreateWidget () or XtSetValues ().
            if (_shell != IntPtr.Zero)
            {
                Xtlib.XtDestroyWidget(_shell);
                _shell = IntPtr.Zero;
            }

            this.DisposeByParent();
        }
コード例 #2
0
        /// <summary> Dispose by parent. </summary>
        public virtual void DisposeByParent()
        {
            // Memory and resources, that are assigned to underlaying Athena widget's
            // instance structure (and thereby owned there) are destroyed by XtDestroyWidget ().
            // This typically inclused the GCs, pixmaps and local copies of strings.
            // They are typically assigned during XtCreateWidget () or XtSetValues ().
            if (_shell != IntPtr.Zero)
            {
                IntPtr display = Xtlib.XtDisplay(_shell);

                if (_appIconPixMap != IntPtr.Zero)
                {
                    X11lib.XFreePixmap(display, _appIconPixMap);
                }

                if (_appMaskPixMap != IntPtr.Zero)
                {
                    X11lib.XFreePixmap(display, _appMaskPixMap);
                }

                Xtlib.XtDestroyWidget(_shell);
                _shell = IntPtr.Zero;
            }
        }