Skip to content

OneMoreCalendar: fix GDI-leaks #2196

@stevencohn

Description

@stevencohn

Batch fix for six confirmed crash / data-corruption / resource-leak bugs found during a code review of the OneMoreCalendar project.

Issues

  1. BitmapExtensions.MapColor mutates shared resource bitmaps — permanently recolors embedded resource bitmaps; icon colors are wrong after the second theme toggle.
  2. SnappedPage STA deadlockTask.Run(...).Result blocks the STA UI thread while OneNote COM marshals back to it, freezing the window.
  3. page.Hyperlink null-deref in ClickCopyPageButton — when GetPageLinks leaves a page with Hyperlink = null (COM error), the next StartsWith call crashes and aborts the clipboard write.
  4. Notebook constructor NPE on missing XML attributes — notebooks with no color attribute throw NullReferenceException, crashing the Settings dialog.
  5. SettingsProvider.Theme crashes on unrecognized enum valueEnum.Parse throws ArgumentException on hand-edited or future-version XML, crashing form load.
  6. YearsForm.HoverMouse leaks GDI handles — two CreateGraphics() objects are never disposed; rapid mouse movement accumulates unreleased HDC handles.

Metadata

Metadata

Assignees

Labels

enhancementGood ol' fashioned programmin! Not user-requestedreleasedAvailable in a released installer

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions