Changeset e5540d0


Ignore:
Timestamp:
Apr 16, 2019 12:37:29 AM (14 months ago)
Author:
zab2 <zab2@…>
Branches:
master
Children:
e967b26
Parents:
7ce81db9
Message:

proper fix for memory bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/AccessFilter.java

    r7ce81db9 re5540d0  
    115115
    116116    private void reload() throws IOException {
     117        Map<Hash, DestTracker> tmp = new HashMap<Hash, DestTracker>();
     118        for (FilterDefinitionElement element : definition.getElements()) {
     119            element.update(tmp);
     120        }
     121       
    117122        synchronized(knownDests) {
    118             knownDests.clear();
    119             for (FilterDefinitionElement element : definition.getElements()) {
    120                 element.update(knownDests);
    121             }
     123            knownDests.keySet().retainAll(tmp.keySet());
     124            for (Hash newHash : tmp.keySet()) {
     125                if (knownDests.containsKey(newHash))
     126                    continue;
     127                knownDests.put(newHash, tmp.get(newHash));
     128            }   
    122129        }
    123130       
Note: See TracChangeset for help on using the changeset viewer.