Fix file manager memory leak in case of out of disk space.
File manager uses its Scintilla view (with its default document) to save and load file so these 2 op won't be done on foreground. The fix decreases the reference of document to save correctly while the failure of saving (out of disk space). Close #5659
This commit is contained in:
parent
1cd454a8d5
commit
4988ee3fd3
@ -1029,6 +1029,8 @@ bool FileManager::saveBuffer(BufferID id, const TCHAR * filename, bool isCopy, g
|
||||
// Note that fwrite() doesn't return the number of bytes written, but rather the number of ITEMS.
|
||||
if (items_written != 1)
|
||||
{
|
||||
_pscratchTilla->execute(SCI_SETDOCPOINTER, 0, _scratchDocDefault);
|
||||
|
||||
if (error_msg != NULL)
|
||||
*error_msg = TEXT("Failed to save file.\nNot enough space on disk to save file?");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user