1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-07-30 15:25:05 +00:00

Fix proxy object timeout in visualization editor

The visualization editor was retaining an IPlugin reference for the
visualization generator selection combo box.  After 5 minutes the
proxy object timed out, so if you left the editor open and inactive
for that long you'd start getting weird errors.

We now keep the script identifier string and use that to get a
fresh IPlugin proxy object.
This commit is contained in:
Andy McFadden
2019-12-28 14:00:48 -08:00
parent 1759317c8c
commit 7c2fbec773
6 changed files with 55 additions and 45 deletions

View File

@@ -132,14 +132,16 @@ namespace PluginCommon {
/// Generates a list of references to instances of active plugins.
/// </summary>
/// <returns>Newly-created list of plugin references.</returns>
public List<IPlugin> GetActivePlugins() {
List<IPlugin> list = new List<IPlugin>(mActivePlugins.Count);
public Dictionary<string, IPlugin> GetActivePlugins() {
Dictionary<string, IPlugin> dict =
new Dictionary<string, IPlugin>(mActivePlugins.Count);
foreach (KeyValuePair<string, IPlugin> kvp in mActivePlugins) {
list.Add(kvp.Value);
// copy the contents; probably not necessary across AppDomain
dict.Add(kvp.Key, kvp.Value);
}
Debug.WriteLine("PluginManager: returning " + list.Count + " plugins (id=" +
Debug.WriteLine("PluginManager: returning " + dict.Count + " plugins (id=" +
AppDomain.CurrentDomain.Id + ")");
return list;
return dict;
}
/// <summary>