View | Details | Raw Unified | Return to bug 1086
Collapse All | Expand All

(-)a/src/core/model/object.cc (-2 / +6 lines)
 Lines 85-91    Link Here 
85
    m_disposed (false),
85
    m_disposed (false),
86
    m_started (false),
86
    m_started (false),
87
    m_aggregates ((struct Aggregates *)malloc (sizeof (struct Aggregates))),
87
    m_aggregates ((struct Aggregates *)malloc (sizeof (struct Aggregates))),
88
    m_getObjectCount (0)
88
    m_getObjectCount (0),
89
    m_disposeAlreadyCalled (false)
89
{
90
{
90
  m_aggregates->n = 1;
91
  m_aggregates->n = 1;
91
  m_aggregates->buffer[0] = this;
92
  m_aggregates->buffer[0] = this;
 Lines 118-124    Link Here 
118
    m_disposed (false),
119
    m_disposed (false),
119
    m_started (false),
120
    m_started (false),
120
    m_aggregates ((struct Aggregates *)malloc (sizeof (struct Aggregates))),
121
    m_aggregates ((struct Aggregates *)malloc (sizeof (struct Aggregates))),
121
    m_getObjectCount (0)
122
    m_getObjectCount (0),
123
    m_disposeAlreadyCalled (false)
122
{
124
{
123
  m_aggregates->n = 1;
125
  m_aggregates->n = 1;
124
  m_aggregates->buffer[0] = this;
126
  m_aggregates->buffer[0] = this;
 Lines 189-194    Link Here 
189
void 
191
void 
190
Object::Dispose (void)
192
Object::Dispose (void)
191
{
193
{
194
  NS_ASSERT_MSG (!m_disposeAlreadyCalled, "Dispose () has already been called on this object");
195
  m_disposeAlreadyCalled = true;
192
  /**
196
  /**
193
   * Note: the code here is a bit tricky because we need to protect ourselves from
197
   * Note: the code here is a bit tricky because we need to protect ourselves from
194
   * modifications in the aggregate array while DoDispose is called. The user's
198
   * modifications in the aggregate array while DoDispose is called. The user's
(-)a/src/core/model/object.h (+6 lines)
 Lines 304-309    Link Here 
304
   * of the array the most-frequently accessed elements.
304
   * of the array the most-frequently accessed elements.
305
   */
305
   */
306
  uint32_t m_getObjectCount;
306
  uint32_t m_getObjectCount;
307
308
  /** 
309
   * used to make sure that Dispose () is not called twice on the same object.
310
   * 
311
   */
312
  bool m_disposeAlreadyCalled;
307
};
313
};
308
314
309
/**
315
/**

Return to bug 1086