Ejemplo n.º 1
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;
            }
        }