Skip to content

Conversation

@ezyuzin
Copy link
Contributor

@ezyuzin ezyuzin commented Dec 30, 2025

Successful testing: appeared in PA, downloaded, and worked as expected for x64 and x86 bit versions.

@chcg chcg added this to the 1.9.1 milestone Jan 1, 2026
@chcg
Copy link
Contributor

chcg commented Jan 1, 2026

@mohzy83 You might want to take a look at it and check what might be worth backporting

@ezyuzin "memory leaks inherited from parental plugin" from https://github.com/ezyuzin/NppAnotherMarkdown/releases/tag/0.1.1 Does parental mean that there are leaks in the NppMarkdownPanel ?

Json files here should be sorted alphabetically could you please move your new entry accordingly after AnalysePlugin. Thanks.

@rdipardo
Copy link
Contributor

rdipardo commented Jan 1, 2026

Does parental mean that there are leaks in the NppMarkdownPanel ?

I have no idea, but I'm aware of at least one unpatched issue with the upstream MarkdowPanel's (dated) infrastructure: the ScNotification struct is not fully 64-bit compatible, which will cause out-of-bounds writes in x64 builds (and, for the purposes of vertical scroll tracking, incorrect SCN_UPDATEUI flags). See:

It seems the latest version of the fork has not corrected this. At the very least, AnnotationLinesAdded should be of type IntPtr. See here for a detailed description of the correct binary layout.

I would also suggest basing the new plugin on Mark Olson's updated .NET Framework template, which eliminates a build-time dependency on .NET 3.5 (a feature scheduled for removal in a future Windows release).

@ezyuzin
Copy link
Contributor Author

ezyuzin commented Jan 2, 2026

@ezyuzin "memory leaks inherited from parental plugin" from https://github.com/ezyuzin/NppAnotherMarkdown/releases/tag/0.1.1 Does parental mean that there are leaks in the NppMarkdownPanel ?

@chcg es, NppMarkdownPanel has these issues, but they do not appear to be major. The amount of unreleased memory is relatively small and becomes noticeable only if the plugin is frequently closed and reopened. In this scenario, some unmanaged resources are not freed after the form is closed and are allocated again when the preview form is reopened. Specifically, the form and EdgeView allocate structures from HGlobal.

dispose patten was added:

    protected virtual void Dispose(bool disposing)
    {
      if (!_disposedValue) {
        if (disposing) {
          _icon?.Dispose();
          _iconBmp?.Dispose();
          _icon = null;
          _iconBmp = null;

          if (_ptrNppTbData.HasValue) {
            **Marshal.DestroyStructure(_ptrNppTbData.Value, typeof(NppTbData));
            Marshal.FreeHGlobal(_ptrNppTbData.Value);**
            _ptrNppTbData = null;
          }
          **_previewForm?.Dispose();**
          _previewForm = null;
        }
        _disposedValue = true;
      }
    }

Json files here should be sorted alphabetically could you please move your new entry accordingly after AnalysePlugin. Thanks.

Done, json entries sorted as you asked

@ezyuzin
Copy link
Contributor Author

ezyuzin commented Jan 2, 2026

@rdipardo tnx, I'm cherrypicked fixes with structure sizes too

ezyuzin/NppAnotherMarkdown@8d259be#diff-51161642c11d8f540c42afa2ec1f20db225b3dbd0b1fc8000d9c0d7551d5896e

@mohzy83
Copy link
Contributor

mohzy83 commented Jan 2, 2026

@mohzy83 You might want to take a look at it and check what might be worth backporting

@chcg - I will try to port the fix over to MarkdownPanel.

@chcg chcg merged commit fa219b9 into notepad-plus-plus:master Jan 3, 2026
3 checks passed
@chcg
Copy link
Contributor

chcg commented Jan 3, 2026

@ezyuzin You might want to have a look at mohzy83/NppMarkdownPanel#143 regarding CI you currently added to your repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants