Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2006-03-23 14:27:18


Bugs item #1457205, was opened at 2006-03-23 19:27
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1457205&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: smart_ptr
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Vladislav Lazarenko (vlazarenko)
Assigned to: Peter Dimov (pdimov)
Summary: shared_ptr<> causes memory leacks and crash

Initial Comment:
I have written this small test to reproduce the bug.
Please see..

#include <cstddef>
#include <boost/shared_ptr.hpp>
#include <boost/test/unit_test.hpp>

using namespace std;
using namespace boost;
using namespace boost::unit_test_framework;

  class A;

  class B
  {
  public:
    B(boost::shared_ptr<A> ptr) : ptr_(ptr) {}
    ~B() {}

  private:
    boost::shared_ptr<A> ptr_;
  };

  class A
  {
  public:
    A(int value) : value_(value) {}
    ~A() {}

  private:
    int value_;
  };

void test_shared_ptr()
{
  BOOST_CHECKPOINT("Testing shared pointer...");

  shared_ptr<A> a1(new A(10));

  {
    shared_ptr<B> b1 = a1->create();
  }

  {
    shared_ptr<B> b1 = a1->create();
  }
}

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1457205&group_id=7586

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk