Skip to content

Commit

Permalink
Fix period backup crash due to the dead lock of std::lock_guard
Browse files Browse the repository at this point in the history
  • Loading branch information
donho committed Mar 28, 2024
1 parent 30f48aa commit cda3f7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions PowerEditor/src/MISC/Common/FileInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ void Win32_IO_File::close()
{
NppParameters& nppParam = NppParameters::getInstance();

//::MessageBoxA(NULL, "Blocked...", "", MB_OK);

DWORD flushError = NOERROR;
if (_written)
{
Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8470,7 +8470,7 @@ DWORD WINAPI Notepad_plus::backupDocument(void * /*param*/)
if (!isSnapshotMode)
break;

::PostMessage(Notepad_plus_Window::gNppHWND, NPPM_INTERNAL_SAVEBACKUP, 0, 0);
::SendMessage(Notepad_plus_Window::gNppHWND, NPPM_INTERNAL_SAVEBACKUP, 0, 0);
}
return TRUE;
}
Expand Down
2 changes: 2 additions & 0 deletions PowerEditor/src/ScintillaComponent/Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,8 @@ bool FileManager::backupCurrentBuffer()
{
if (buffer->isModified()) // buffer dirty and modified, write the backup file
{
::MessageBoxA(NULL, "INSIDE", "", MB_OK);

UniMode mode = buffer->getUnicodeMode();
if (mode == uniCookie)
mode = uni8Bit; //set the mode to ANSI to prevent converter from adding BOM and performing conversions, Scintilla's data can be copied directly
Expand Down

0 comments on commit cda3f7a

Please sign in to comment.