| 1 | // Observable Library | 
|---|---|
| 2 | // Copyright (c) 2016 David Capello | 
| 3 | // | 
| 4 | // This file is released under the terms of the MIT license. | 
| 5 | // Read LICENSE.txt for more information. | 
| 6 | |
| 7 | #include "obs/connection.h" | 
| 8 | #include "obs/signal.h" | 
| 9 | |
| 10 | namespace obs { | 
| 11 | |
| 12 | void connection::disconnect() { | 
| 13 | if (!m_slot) | 
| 14 | return; | 
| 15 | |
| 16 | assert(m_signal); | 
| 17 | if (m_signal) | 
| 18 | m_signal->disconnect_slot(m_slot); | 
| 19 | |
| 20 | delete m_slot; | 
| 21 | m_slot = nullptr; | 
| 22 | } | 
| 23 | |
| 24 | } // namespace obs | 
| 25 | 
