File tree Expand file tree Collapse file tree 2 files changed +21
-8
lines changed
pvAccessJava/src/org/epics Expand file tree Collapse file tree 2 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -78,12 +78,18 @@ public ChannelProvider newInstance() {
7878 }
7979 }
8080
81- public synchronized void destroySharedInstance () {
81+ public synchronized boolean destroySharedInstance () {
82+ boolean destroyed = true ;
8283 if (channelProvider != null )
8384 {
84- channelProvider .destroy ();
85- channelProvider = null ;
85+ try {
86+ channelProvider .destroy ();
87+ channelProvider = null ;
88+ } catch (Exception ex ) {
89+ destroyed = false ;
90+ }
8691 }
92+ return destroyed ;
8793 }
8894 }
8995
@@ -103,8 +109,10 @@ public static synchronized void stop() {
103109 if (factory != null )
104110 {
105111 ChannelProviderRegistryFactory .unregisterChannelProviderFactory (factory );
106- factory .destroySharedInstance ();
107- factory =null ;
112+ if (factory .destroySharedInstance ())
113+ {
114+ factory =null ;
115+ }
108116 }
109117 }
110118
Original file line number Diff line number Diff line change @@ -70,12 +70,15 @@ public ChannelProvider newInstance() {
7070 }
7171 }
7272
73- public synchronized void destroySharedInstance () {
73+ public synchronized boolean destroySharedInstance () {
74+ boolean destroyed = true ;
7475 if (context != null )
7576 {
7677 context .dispose ();
78+ destroyed = context .isDestroyed ();
7779 context = null ;
7880 }
81+ return destroyed ;
7982 }
8083 }
8184
@@ -95,8 +98,10 @@ public static synchronized void stop() {
9598 if (factory != null )
9699 {
97100 ChannelProviderRegistryFactory .unregisterChannelProviderFactory (factory );
98- factory .destroySharedInstance ();
99- factory =null ;
101+ if (factory .destroySharedInstance ())
102+ {
103+ factory =null ;
104+ }
100105 }
101106 }
102107}
You can’t perform that action at this time.
0 commit comments