close Warning: Can't use blame annotator:
No changeset 10511 in the repository

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

Last change on this file since 10688 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
RevLine 
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.