Skip to content

After saving the XML file, the directory containing the file becomes locked and cannot be deleted. #231

@softmgr

Description

@softmgr

For more details about this issue, see:
notepad-plus-plus/notepad-plus-plus#16974

I have checked the XMLTools source code and identified the root cause. The fix needs to be made in ToolsXmlValidate.cpp:

int performXMLCheck(int informIfNoError) {
    dbgln("performXMLCheck()");

    // -1. save old current folder
    wchar_t oldPath[MAX_PATH]{};
    if (!_wgetcwd(oldPath, MAX_PATH)) {
        // Failed to retrieve folder
        return -1;
    }

    // ...
    // ...

    // 1. Restore the original folder
    _wchdir(oldPath);

    return res;
}
void XMLValidation(int informIfNoError) {
    dbgln("XMLValidation()");

    // -1. save old current folder
    wchar_t oldPath[MAX_PATH]{};
    if (!_wgetcwd(oldPath, MAX_PATH)) {
        // Failed to retrieve folder
        return;
    }

    // ...
    // ...

    // 2. Restore the original folder
    _wchdir(oldPath);
}

Until this issue is resolved, you can temporarily disable it by unchecking Enable XML syntax auto-check in the plugins menu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions