Skip to content

Commit

Permalink
Add disconnect() member function to scoped_connection
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Mar 26, 2021
1 parent af94c4a commit bddbeed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion obs/connection.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Observable Library
// Copyright (c) 2016 David Capello
// Copyright (c) 2016-2021 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
Expand Down Expand Up @@ -54,6 +54,12 @@ class scoped_connection {
m_conn.disconnect();
}

// Just in case that we want to disconnect the signal in the middle
// of the scope.
void disconnect() {
m_conn.disconnect();
}

private:
connection m_conn;
};
Expand Down

0 comments on commit bddbeed

Please sign in to comment.