CUAHSI / HydroDesktop

HydroDesktop is a free and open source GIS enabled desktop application that helps you search for, download, visualize, and analyze hydrologic and climate data registered with the CUAHSI Hydrologic Information System. HydroDesktop is part of the legacy CUAHSI toolkit and is not under active development. Click the "releases" link below to download the latest installer for Microsoft Windows.
73 stars 20 forks source link

Download Manager Logging Crashes on Mono #103

Open xhqiao89 opened 6 years ago

xhqiao89 commented 6 years ago

shieldst[CodePlex]
Problem The Download Manager has a log feature that displays information about the status of the various downloads it is making. Something about this log feature causes HydroDesktop to crash on Mono (I know for sure it crashes on Mac OS; I can't remember if it crashes on Linux). You can replicate this by removing the condition below and attempting to download data from one or more data sites; as soon as the Download Manager window appears, the program will crash. Temporary Solution I have added a condition in DownloadManagerUI.cs to update the log only if we are not running on Mono, which at least fixes the crashing issue, but removes a fairly important piece of functionality from HydroDesktop when running on Mono. private void ThreadSafeAddItemToLog(ListBox listBox, object value) { if (!DotSpatial.Mono.Mono.IsRunningOnMono()) { listBox.UIThread (delegate { try { listBox.Items.Add(value);

                             // scroll to last item if need
                             if (IsAutoScrollDetailsLog)
                             {
                                 listBox.SelectedIndex = listBox.Items.Count - 1;
                             }
                         }
                         catch (Exception e)
                         {
                             Debug.WriteLine(quotException: quot + e.Message);
                             Debug.WriteLine(e.StackTrace);
                         }
                     }
                );
        }
    }

My guess is that something about the threads updating the listBox that displays the log is not handled correctly by Mono, thus causing the crash. Regardless, we need to fix this so that the same information available on Windows is available on Mono.

xhqiao89 commented 6 years ago

cuylerfris[CodePlex]
marking as active