diff options
author | nyamatongwe <devnull@localhost> | 2007-11-23 03:13:29 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2007-11-23 03:13:29 +0000 |
commit | 08f2d073c69ec8a5824d873ec402d4624a42de45 (patch) | |
tree | 4a0b2c373523a1b26343ddf333f1cd366bfc32bc /src | |
parent | a3a7753f0956d8f0cd1947dd38984e01939b97db (diff) | |
download | scintilla-mirror-08f2d073c69ec8a5824d873ec402d4624a42de45.tar.gz |
Ensure palette is not selected into any surfaces when it may need to be
released. Stops resource leaks in palette mode.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9107102ff..8de5bcd15 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -225,8 +225,8 @@ void Editor::DropGraphics() { void Editor::InvalidateStyleData() { stylesValid = false; - palette.Release(); DropGraphics(); + palette.Release(); llc.Invalidate(LineLayout::llInvalid); posCache.Clear(); if (selType == selRectangle) { @@ -2770,6 +2770,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { //Platform::DebugPrintf("Paint:%1d (%3d,%3d) ... (%3d,%3d)\n", // paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom); + pixmapLine->Release(); RefreshStyleData(); RefreshPixMaps(surfaceWindow); @@ -2799,10 +2800,17 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { pdoc->EnsureStyledTo(endPosPaint); bool paintAbandonedByStyling = paintState == paintAbandoned; if (needUpdateUI) { + // Deselect palette by selecting a temporary palette + Palette palTemp; + surfaceWindow->SetPalette(&palTemp, true); + NotifyUpdateUI(); needUpdateUI = false; + RefreshStyleData(); RefreshPixMaps(surfaceWindow); + surfaceWindow->SetPalette(&palette, true); + pixmapLine->SetPalette(&palette, !hasFocus); } // Call priority lines wrap on a window of lines which are likely |