Skip to content

Commit

Permalink
- bumped Qiqqa version for release
Browse files Browse the repository at this point in the history
- migrated to a simpler Dispose approach where SafeExec() has a single function: executing the code and catching any crashes, so the outer code layer can continue executing without trouble. The 'must run in UI thread' requirement for all WPF Controls is enforced by using the appropriate WPFDoEvents.InvokeInUIThread() API: this is a **synchronous** call **intentionally**: the Dispose() call won't wait for async stuff to do their thing.
- augmented the documentation for the developer overrides json5 config file
  • Loading branch information
GerHobbelt committed Jan 16, 2021
1 parent 9fd31ca commit 90177e1
Show file tree
Hide file tree
Showing 93 changed files with 1,193 additions and 1,017 deletions.
2 changes: 1 addition & 1 deletion Qiqqa.Build/ClientVersion.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ClientVersionInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<LatestVersion>83.0.7649.30836</LatestVersion>
<LatestVersion>83.0.7655.37537</LatestVersion>
<CompliantFromVersion>81</CompliantFromVersion>
<ObsoleteToVersion xsi:nil="true" />
<DownloadLocations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>83.0.7649.30836</ApplicationVersion>
<ApplicationVersion>83.0.7655.37537</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("83.0.7649.30836")]
[assembly: AssemblyFileVersion("83.0.7649.30836")]
[assembly: AssemblyVersion("83.0.7655.37537")]
[assembly: AssemblyFileVersion("83.0.7655.37537")]
Binary file modified Qiqqa.Build/Packaging/Include/couninst.exe
Binary file not shown.
25 changes: 14 additions & 11 deletions Qiqqa/AnnotationsReportBuilding/ReportViewerControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,22 @@ protected virtual void Dispose(bool disposing)
{
Logging.Debug("ReportViewerControl::Dispose({0}) @{1}", disposing, dispose_count);

WPFDoEvents.SafeExec(() =>
WPFDoEvents.InvokeInUIThread(() =>
{
// Get rid of managed resources
ObjDocumentViewer.Document?.Blocks.Clear();
}, must_exec_in_UI_thread: true);

WPFDoEvents.SafeExec(() =>
{
ObjDocumentViewer.Document = null;
annotation_report = null;
WPFDoEvents.SafeExec(() =>
{
// Get rid of managed resources
ObjDocumentViewer.Document?.Blocks.Clear();
});
WPFDoEvents.SafeExec(() =>
{
ObjDocumentViewer.Document = null;
annotation_report = null;
});
++dispose_count;
});

++dispose_count;
}

#endregion
Expand Down
31 changes: 17 additions & 14 deletions Qiqqa/Brainstorm/Nodes/PDFAnnotationNodeContentControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,28 @@ protected virtual void Dispose(bool disposing)
{
Logging.Debug("PDFAnnotationNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

WPFDoEvents.SafeExec(() =>
WPFDoEvents.InvokeInUIThread(() =>
{
if (dispose_count == 0)
WPFDoEvents.SafeExec(() =>
{
library_index_hover_popup?.Dispose();
if (dispose_count == 0)
{
library_index_hover_popup?.Dispose();
ToolTipClosing -= PDFDocumentNodeContentControl_ToolTipClosing;
ToolTipOpening -= PDFDocumentNodeContentControl_ToolTipOpening;
}
});
ToolTipClosing -= PDFDocumentNodeContentControl_ToolTipClosing;
ToolTipOpening -= PDFDocumentNodeContentControl_ToolTipOpening;
}
});
WPFDoEvents.SafeExec(() =>
{
// Clear the references for sanity's sake
pdf_annotation_node_content = null;
library_index_hover_popup = null;
});
WPFDoEvents.SafeExec(() =>
{
// Clear the references for sanity's sake
pdf_annotation_node_content = null;
library_index_hover_popup = null;
});
++dispose_count;
++dispose_count;
});
}

#endregion
Expand Down
45 changes: 24 additions & 21 deletions Qiqqa/Brainstorm/Nodes/PDFDocumentNodeContentControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,33 +433,36 @@ protected virtual void Dispose(bool disposing)
{
Logging.Debug("PDFDocumentNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

WPFDoEvents.SafeExec(() =>
WPFDoEvents.InvokeInUIThread(() =>
{
if (dispose_count == 0)
WPFDoEvents.SafeExec(() =>
{
library_index_hover_popup?.Dispose();
}
library_index_hover_popup = null;
});
if (dispose_count == 0)
{
library_index_hover_popup?.Dispose();
}
library_index_hover_popup = null;
});
WPFDoEvents.SafeExec(() =>
{
ToolTip = "";
});
WPFDoEvents.SafeExec(() =>
{
ToolTip = "";
});
WPFDoEvents.SafeExec(() =>
{
node_control = null;
pdf_document_node_content = null;
});
WPFDoEvents.SafeExec(() =>
{
node_control = null;
pdf_document_node_content = null;
});
WPFDoEvents.SafeExec(() =>
{
DataContextChanged -= PDFDocumentNodeContentControl_DataContextChanged;
DataContext = null;
});
WPFDoEvents.SafeExec(() =>
{
DataContextChanged -= PDFDocumentNodeContentControl_DataContextChanged;
DataContext = null;
});
++dispose_count;
++dispose_count;
});
}

#endregion
Expand Down
41 changes: 22 additions & 19 deletions Qiqqa/Brainstorm/Nodes/StringNodeContentControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,31 +120,34 @@ protected virtual void Dispose(bool disposing)
{
Logging.Debug("StringNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

WPFDoEvents.SafeExec(() =>
WPFDoEvents.InvokeInUIThread(() =>
{
if (dispose_count == 0)
WPFDoEvents.SafeExec(() =>
{
// Get rid of managed resources / get rid of cyclic references:
fader?.Dispose();
}
fader = null;
});
if (dispose_count == 0)
{
// Get rid of managed resources / get rid of cyclic references:
fader?.Dispose();
}
fader = null;
});
WPFDoEvents.SafeExec(() =>
{
MouseDoubleClick -= StringNodeContentControl_MouseDoubleClick;
KeyDown -= StringNodeContentControl_KeyDown;
WPFDoEvents.SafeExec(() =>
{
MouseDoubleClick -= StringNodeContentControl_MouseDoubleClick;
KeyDown -= StringNodeContentControl_KeyDown;
TxtEdit.LostFocus -= edit_text_box_LostFocus;
TxtEdit.PreviewKeyDown -= edit_text_box_PreviewKeyDown;
});
TxtEdit.LostFocus -= edit_text_box_LostFocus;
TxtEdit.PreviewKeyDown -= edit_text_box_PreviewKeyDown;
});
WPFDoEvents.SafeExec(() =>
{
DataContext = null;
});
WPFDoEvents.SafeExec(() =>
{
DataContext = null;
++dispose_count;
});

++dispose_count;
}

#endregion
Expand Down
29 changes: 16 additions & 13 deletions Qiqqa/Brainstorm/Nodes/WebsiteNodeContentControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,26 @@ protected virtual void Dispose(bool disposing)
{
Logging.Debug("WebsiteNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

WPFDoEvents.SafeExec(() =>
WPFDoEvents.InvokeInUIThread(() =>
{
if (dispose_count == 0)
WPFDoEvents.SafeExec(() =>
{
// Get rid of managed resources / get rid of cyclic references:
fader?.Dispose();
}
fader = null;
});
if (dispose_count == 0)
{
// Get rid of managed resources / get rid of cyclic references:
fader?.Dispose();
}
fader = null;
});
WPFDoEvents.SafeExec(() =>
{
website_node_content = null;
DataContext = null;
});
WPFDoEvents.SafeExec(() =>
{
website_node_content = null;
DataContext = null;
++dispose_count;
});

++dispose_count;
}

#endregion
Expand Down
19 changes: 11 additions & 8 deletions Qiqqa/Brainstorm/SceneManager/BrainstormControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,20 @@ protected virtual void Dispose(bool disposing)
{
Logging.Debug("BrainstormControl::Dispose({0}) @{1}", disposing, dispose_count);

WPFDoEvents.SafeExec(() =>
WPFDoEvents.InvokeInUIThread(() =>
{
if (dispose_count == 0)
WPFDoEvents.SafeExec(() =>
{
// Get rid of managed resources
SceneRenderingControl?.Dispose();
}
SceneRenderingControl = null;
if (dispose_count == 0)
{
// Get rid of managed resources
SceneRenderingControl?.Dispose();
}
SceneRenderingControl = null;
});
++dispose_count;
});

++dispose_count;
}

#endregion
Expand Down
59 changes: 31 additions & 28 deletions Qiqqa/Brainstorm/SceneManager/SceneRenderingControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1387,45 +1387,48 @@ protected virtual void Dispose(bool disposing)
{
Logging.Debug("SceneRenderingControl::Dispose({0}) @{1}", disposing, dispose_count);

WPFDoEvents.SafeExec(() =>
WPFDoEvents.InvokeInUIThread(() =>
{
if (dispose_count == 0)
WPFDoEvents.SafeExec(() =>
{
// Get rid of managed resources
AutoArranger?.Enabled(false);
if (dispose_count == 0)
{
// Get rid of managed resources
AutoArranger?.Enabled(false);
node_controls.Clear();
}
}, must_exec_in_UI_thread: true);
node_controls.Clear();
}
});
WPFDoEvents.SafeExec(() =>
{
brainstorm_metadata_control = null;
brainstorm_metadata = null;
WPFDoEvents.SafeExec(() =>
{
brainstorm_metadata_control = null;
brainstorm_metadata = null;
auto_arranger = null;
drag_drop_manager = null;
basic_drag_drop_behaviours = null;
auto_arranger = null;
drag_drop_manager = null;
basic_drag_drop_behaviours = null;
selected_connector_control = null;
selecting_nodes_control = null;
});
selected_connector_control = null;
selecting_nodes_control = null;
});
WPFDoEvents.SafeExec(() =>
{
node_controls.Clear();
});
WPFDoEvents.SafeExec(() =>
{
node_controls.Clear();
});
WPFDoEvents.SafeExec(() =>
{
connector_control_manager = null;
WPFDoEvents.SafeExec(() =>
{
connector_control_manager = null;
SelectedNodeControlChanged = null;
SelectedNodeControlChanged = null;
ScrollInfoChanged = null;
});
ScrollInfoChanged = null;
});
++dispose_count;
++dispose_count;
});
}

#endregion
Expand Down
2 changes: 2 additions & 0 deletions Qiqqa/Common/MainWindowServiceDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ internal BrainstormControl OpenSampleBrainstorm()
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "<Pending>")]
public WebBrowserHostControl OpenWebBrowser()
{
WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

const string window_key = "WebBrowser";

WebBrowserHostControl existing_control = (WebBrowserHostControl)main_window.DockingManager.MakeActive(window_key);
Expand Down
Loading

0 comments on commit 90177e1

Please sign in to comment.