You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by tj...@apache.org on 2022/03/11 16:45:33 UTC

[felix-dev] branch master updated: FELIX-6511: Cancel the SCR Component Registry's changeCountTimer on deactivation.

This is an automated email from the ASF dual-hosted git repository.

tjwatson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git


The following commit(s) were added to refs/heads/master by this push:
     new ce1c7a9  FELIX-6511: Cancel the SCR Component Registry's changeCountTimer on deactivation.
     new f3597cc  Merge pull request #131 from chrisr3/chrisr3-scr-shutdown
ce1c7a9 is described below

commit ce1c7a9b8483e24d1e489d6edc8a2776f5df348b
Author: Chris Rankin <ch...@r3.com>
AuthorDate: Fri Mar 11 11:54:18 2022 +0000

    FELIX-6511: Cancel the SCR Component Registry's changeCountTimer on deactivation.
---
 scr/src/main/java/org/apache/felix/scr/impl/Activator.java       | 1 +
 .../main/java/org/apache/felix/scr/impl/ComponentRegistry.java   | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/scr/src/main/java/org/apache/felix/scr/impl/Activator.java b/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
index 71b4f05..05a5d8a 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
@@ -407,6 +407,7 @@ public class Activator extends AbstractExtender
         // dispose component registry
         if ( m_componentRegistry != null )
         {
+            m_componentRegistry.shutdown();
             m_componentRegistry = null;
         }
 
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java b/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
index 7169f87..a4cb54d 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java
@@ -732,7 +732,7 @@ public class ComponentRegistry
             final Timer timer;
             synchronized ( this.changeCountTimerLock ) {
                 if ( this.changeCountTimer == null ) {
-                    this.changeCountTimer = new Timer();
+                    this.changeCountTimer = new Timer("SCR Component Registry", true);
                 }
                 timer = this.changeCountTimer;
             }
@@ -774,4 +774,11 @@ public class ComponentRegistry
             }
         }
     }
+
+    public void shutdown() {
+        final Timer timer = changeCountTimer;
+        if (timer != null) {
+            timer.cancel();
+        }
+    }
 }