Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1016262 // fixSwingTitledBorderMemoryLeak

JavaX fragment (include)

import java.beans.*;

static NotTooOften fixSwingTitledBorderMemoryLeak_notTooOften = onlyEvery10Secs(); // just for printing

svoid fixSwingTitledBorderMemoryLeak() {
  PropertyChangeListener[] l = UIManager.getPropertyChangeListeners();
  for (O o : l)
    if (eq(className(o), "javax.swing.border.TitledBorder$1")
      && getOpt(o, "this$0") != null) {
      setOpt(o, "this$0", null);
      if (fixSwingTitledBorderMemoryLeak_notTooOften.yo())
        print("FIXED TitledBorder bug.");
    }
}

Author comment

Began life as a copy of #1016261

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016262
Snippet name: fixSwingTitledBorderMemoryLeak
Eternal ID of this version: #1016262/5
Text MD5: 64be15df52d611432fb995e116e7a59a
Author: stefan
Category: javax / modules
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-16 13:36:30
Source code size: 511 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 326 / 365
Version history: 4 change(s)
Referenced in: [show references]