Project

General

Profile

Bug #3022

frame widgets and menus remain registered to ConfigManager and LogicalTerminal

Added by Ovidiu Maxiniuc about 8 years ago. Updated about 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

History

#1 Updated by Greg Shah about 8 years ago

  • Project changed from Liberty to User Interface

#2 Updated by Ovidiu Maxiniuc about 8 years ago

I noticed that information about widgets created by a procedure remain in ConfigManager and LogicalTerminal data structures. I don't think they do harm except for mem leak.
To see the list of items I added the following code at the end of ConfigManager:

public static void dumpWidgetConfigs()
{
    ConfigManager mgr = ConfigManager.getInstance();
    System.err.print("Widget configs:");
    for (WidgetId mId : mgr.widgetCfg.keySet())
    {
       System.err.print(" " + mId.asInt());
    }
    System.err.println();
}

and LogicalTerminal:
public static void dumpWidgetRegistry()
{
    LogicalTerminal lt = LogicalTerminal.locate();
    System.err.print("Widgets:");
    for (Integer wId : lt.widgetRegistry.keySet())
    {
       System.err.print(" " + wId);
    }
    System.err.print("\nMenus:");
    for (Integer mId : lt.menuRegistry.keySet())
    {
       System.err.print(" " + mId);
    }
    System.err.println();
} 

On the very last line of the test launcher procedure (a2862_0.p) which does not define any frame or menus I called them:
       LogicalTerminal.dumpWidgetRegistry();
       ConfigManager.dumpWidgetConfigs(); 

At this moment the structures should contain only information for the default window because the called procedures have finished and they were cleanup/finalized.

I understand that for menus, the management is more complicated.
The frames and their widgets, they seem to persist even if LogicalTerminal.hideAll() is called just before the above code.
The result for my testcase (see uast/frames/shared2 in testcases repo) will look like this:

Widgets: 4 5 6 7 9 10 11 14 16 17 18 21 22 23 24 26 27 28 31 33 34 35 57 58 59 60 61 91 92 93 97 98 99
Menus: 57 90 61
Widget configs: 61 1

Also available in: Atom PDF