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

13
LINES

< > BotCompany Repo | #1008864 // autoCleanUp - register object for automatic clean-up when program exits

JavaX fragment (include)

1  
static Map<O, Bool> autoCleanUp_list = newWeakHashMap();
2  
3  
static <A> A autoCleanUp(A a) {
4  
  if (a != null)
5  
    autoCleanUp_list.put(a, true);
6  
  ret a;
7  
}
8  
9  
static void cleanMeUp_autoCleanUp() {
10  
  L l = cloneList(keys(autoCleanUp_list));
11  
  autoCleanUp_list.clear();
12  
  cleanUp(l);
13  
}

Author comment

Began life as a copy of #1003121

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008864
Snippet name: autoCleanUp - register object for automatic clean-up when program exits
Eternal ID of this version: #1008864/5
Text MD5: 5bbb462f005e2506bafa29a2e8bc55ea
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-10 16:15:16
Source code size: 290 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 489 / 549
Version history: 4 change(s)
Referenced in: [show references]