Don Ho fb6d79b3af Fix crash on closing a disconnected network file tab
Context: While the network file is disconnected, it's considered non-existent and might to be deleted.

The reason of crash:
"doClose" on the same buffer happens twice while users clicks X button, then chooses "No" when they are asked whether if this file should be kept in editor.

Explanation:
When user clicks X button on the tab of the file in question to close it, "activateBuffer" is called, then "fileClose" is called.
* activateBuffer: Following "activeateBuffer" call in the depth, "checkFileState" is invoked - that leads the message "The file "xxxxxx" doesn't exist anymore. Keep this file in Editor?". If user clicks on No, "doClose" will close the tab and destroy the buffer.
* fileClose: in "fileClose" call, "doClose" will be invoked and try to close the already-destroyed buffer.

Solution:
Retrieve the buffer ID once again, after "activateBuffer" call, for comparing with old buffer ID. If the buffer was destroyed, the new retrieved buffer ID is not the same.

Note: this commit fixes the crash, but it doesn't fix the misbehaviour: If user clicks on "Yes" to answer the message "The file "xxxxxx" doesn't exist anymore. Keep this file in Editor?", the tab will be still closed.

Fix #15684, close #15685
2024-10-08 16:48:52 +02:00
2023-04-06 14:12:52 +02:00
2023-11-03 23:26:44 +01:00
2024-05-25 16:19:47 +02:00
2024-02-03 15:04:34 +01:00
2024-03-13 00:32:57 +01:00
2024-03-14 04:33:24 +01:00
2024-02-01 16:28:17 +01:00

What is Notepad++ ?

GitHub release    Build Status     Join the discussions at https://community.notepad-plus-plus.org/

Notepad++ is a free (free as in both "free speech" and "free beer") source code editor and Notepad replacement that supports several programming languages and natural languages. Running in the MS Windows environment, its use is governed by GPL License.

See the Notepad++ official site for more information.

Notepad++ Release Key

Since the release of version 7.6.5 Notepad++ is signed using GPG with the following key:

  • Signer: Notepad++
  • E-mail: don.h@free.fr
  • Key ID: 0x8D84F46E
  • Key fingerprint: 14BC E436 2749 B2B5 1F8C 7122 6C42 9F1D 8D84 F46E
  • Key type: RSA 4096/4096
  • Created: 2019-03-11
  • Expires: 2027-03-13

https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/nppGpgPub.asc

Supported OS

All the Windows systems still supported by Microsoft are supported by Notepad++. However, not all Notepad++ users can or want to use the newest system. Here is the Supported systems information you may need in case you are one of them.

Build Notepad++

Please follow build guide to build Notepad++ from source.

Contribution

Contributions are welcome. Be mindful of our Contribution Rules to increase the likelihood of your contribution getting accepted.

Notepad++ Contributors

Description
Notepad++ official repository
Readme GPL-3.0 407 MiB
Languages
C++ 79.4%
HTML 11%
C 2.8%
Objective-C++ 1.8%
Python 1.7%
Other 2.6%