source: source/ariba/utility/transport/messages/shared_buffer.cpp@ 12766

Last change on this file since 12766 was 10673, checked in by Michael Tänzer, 12 years ago

Merge bugfix into trunk: Fix intialisation of static variable. Only relevant
when compiling in debug mode

File size: 840 bytes
Line 
1//-----------------------------------------------------------------------------
2// Part of reboost (http://reboost.org). Released under the
3// BSD 2-clause license (http://www.opensource.org/licenses/bsd-license.php).
4// Copyright 2012, Sebastian Mies <mies@reboost.org> --- All rights reserved.
5//-----------------------------------------------------------------------------
6
7#include "shared_buffer.hpp"
8#include <iostream>
9
10namespace reboost {
11
12using namespace std;
13
14#ifdef DEBUG
15
16void shared_buffer_t::onexit() {
17 if (allocated_buffers != 0)
18 cerr << "shared_buffer_t: " << allocated_buffers << " leaked buffers." << endl;
19}
20
21size_t shared_buffer_t::init() {
22 atexit(&shared_buffer_t::onexit);
23 return 0;
24}
25
26size_t shared_buffer_t::allocated_buffers = init();
27boost::mutex shared_buffer_t::allocated_buffers_mutex;
28
29#endif //DEBUG
30
31}
Note: See TracBrowser for help on using the repository browser.