Bug Report T349473
Visible to All Users

Bars - The "Cannot access a disposed object" exception is thrown when repeatedly opening the font menus

created 9 years ago (modified 9 years ago)

We have RichEditControl with Menumanager (BarManager) in a simple XtraUserControl form placed inside a window (XtraForm)

This is to allow the user to format styles, fonts etc.

When the user selects the down arrow (see attachment) and then selects any font size from the font size dropdownlist the following exception is thrown:

Cannot access a disposed object.Object name: 'QuickCustomizationBarControl'.
   at System.Windows.Forms.Control.CreateHandle()   at System.Windows.Forms.Control.get_Handle()   at System.Windows.Forms.Control.PointToClientInternal(Point p)   at DevExpress.XtraBars.Controls.CustomLinksControl.CheckUpdateHyperlink(BarItemLink link, Point pt)   at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseMoveCore(MouseEventArgs e)   at DevExpress.XtraBars.Controls.CustomPopupBarControl.OnMouseMoveCore(MouseEventArgs e)   at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseMove(MouseEventArgs e)   at System.Windows.Forms.Control.WmMouseMove(Message& m)   at System.Windows.Forms.Control.WndProc(Message& m)   at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
What can be done to prevent this exception from happening, as this seems not to originate from any code block by our developers.

Thanks

Comments (3)

    Here is a simple project where I was able to reproduce the exception. If you repetitively select from "font style" and "font size" dropdownlists after a few times the following exception will be thrown:

    System.ObjectDisposedException was unhandled  HResult=-2146232798  Message=Cannot access a disposed object.Object name: 'QuickCustomizationBarControl'.  ObjectName=QuickCustomizationBarControl  Source=System.Windows.Forms  StackTrace:       at System.Windows.Forms.Control.CreateHandle()       at System.Windows.Forms.Control.get_Handle()       at System.Windows.Forms.Control.PointToClientInternal(Point p)       at DevExpress.XtraBars.Controls.CustomLinksControl.GetLinkByPoint(Point screenPoint, Boolean includeSeparator)       at DevExpress.XtraBars.Controls.CustomLinksControl.GetLinkByPoint(Point screenPoint)       at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseMoveCore(MouseEventArgs e)       at DevExpress.XtraBars.Controls.CustomPopupBarControl.OnMouseMoveCore(MouseEventArgs e)       at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseMove(MouseEventArgs e)       at System.Windows.Forms.Control.WmMouseMove(Message& m)       at System.Windows.Forms.Control.WndProc(Message& m)       at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)       at System.Windows.Forms.Application.Run(Form mainForm)       at TestXtraBars.Program.Main() in c:\users\omart\documents\visual studio 2015\Projects\TestXtraBars\TestXtraBars\Program.cs:line 19       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)       at System.Threading.ThreadHelper.ThreadStart()  InnerException:

      To better explain what I mean be selecting between "font style" and "font size" here is an image showing the selection

      Andrew Ser (DevExpress Support) 9 years ago

        Hello,
        Thank you for the detailed description. We greatly appreciate it.
        I've passed this ticket to our R&D team for further research. We will update it once we make progress.

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (2)

            I believe I'm having the same issue in a production version of our product which is still using 11.2.14.

            When I use the Ribbon linked to a rich text control, it works fine. But when I host a RichTextEdit as a repository item within a grid cell, opening the font settings crashes immediately with an ObjectDisposedException.

            DevExpress Support Team 9 years ago

              Hello Leon,

              To avoid any misunderstanding, it is better to research this issue separately. I created a new ticket on your behalf: T359497: The application crashes with the ObjectDisposedException and will reply in that ticket soon.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.