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

16
LINES

< > BotCompany Repo | #1018601 // unfixSwingTitledBorderMemoryLeak - to allow changing L&F [seems to work]

JavaX fragment (include)

import java.beans.*;

please include function fixSwingTitledBorderMemoryLeak.

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

Author comment

Began life as a copy of #1016262

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018601
Snippet name: unfixSwingTitledBorderMemoryLeak - to allow changing L&F [seems to work]
Eternal ID of this version: #1018601/4
Text MD5: 5c679c88c0e21ac7533029086fc8e9b3
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:38:30
Source code size: 581 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 285 / 330
Version history: 3 change(s)
Referenced in: [show references]