File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -169,17 +169,26 @@ class Launcher : public PluginHost::IPlugin {
169169
170170 public:
171171 void Register (IProcessState* observer) {
172+ ASSERT (observer != nullptr );
173+
172174 _adminLock.Lock ();
173- ASSERT (std::find (_callbacks.begin (), _callbacks.end (), observer) == _callbacks.end ());
175+ auto found = std::find (_callbacks.begin (), _callbacks.end (), observer);
176+ ASSERT (found == _callbacks.end ());
177+
174178 if (_callbacks.empty ()) {
175179 const bool opened = Open ();
176180 DEBUG_VARIABLE (opened);
177181 ASSERT (opened);
178182 }
179- _callbacks.push_back (observer);
183+ if (found == _callbacks.end ()) {
184+ _callbacks.push_back (observer);
185+ }
186+
180187 _adminLock.Unlock ();
181188 }
182189 void Unregister (IProcessState* observer) {
190+ ASSERT (observer != nullptr );
191+
183192 _adminLock.Lock ();
184193 auto found = std::find (_callbacks.begin (), _callbacks.end (), observer);
185194 ASSERT (found != _callbacks.end ());
You can’t perform that action at this time.
0 commit comments