Menu

#2268 Cocoa View leaks memory

Bug
closed-fixed
nobody
5
2021-09-22
2021-07-21
No

The cocoa implemention leaks memory. [ScintillaView dealloc] is never called and that happens because of a circular dependency with the ScintillaCocoa c++ class.
To fix this issue the ScintillaCocoa c++ class needs to declare the sciView and delegate varaibles as weak:
__weak ScintillaView *sciView;
__weak id<scintillanotificationprotocol> delegate;
After making this change the [ScintillaView dealloc] is called when a window which contains this view is closed.</scintillanotificationprotocol>

Discussion

  • Neil Hodgson

    Neil Hodgson - 2021-07-23
    • labels: --> scintilla, macos
    • status: open --> open-accepted
     
  • Neil Hodgson

    Neil Hodgson - 2021-07-23

    Its too big of a change to make just before a release so I'll look at this again after 5.1.1 is released.

     
  • Neil Hodgson

    Neil Hodgson - 2021-07-27
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-07-27

    Committed fix as [ef0596].

     

    Related

    Commit: [ef0596]

  • Neil Hodgson

    Neil Hodgson - 2021-09-22
    • status: open-fixed --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-09-22

    Its too big of a change to make just before a release so I'll look at this again after 5.1.1 is released.

     

Log in to post a comment.