This repository was archived by the owner on Jul 24, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ namespace Sass {
62
62
// AST_Node_Ptr ast = dynamic_cast<AST_Node*>(node);
63
63
if (node->dbg ) std::cerr << " DELETE NODE " << node << " \n " ;
64
64
#endif
65
- delete node;
66
- node = NULL ;
65
+ delete (node);
67
66
}
68
67
}
69
68
}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ namespace Sass {
48
48
size_t line;
49
49
#endif
50
50
static bool taint;
51
- size_t refcounter;
51
+ long refcounter;
52
52
#ifdef DEBUG_SHARED_PTR
53
53
bool dbg;
54
54
#endif
@@ -72,9 +72,6 @@ namespace Sass {
72
72
void setDbg (bool dbg) {
73
73
this ->dbg = dbg;
74
74
}
75
- size_t getRefCount () const {
76
- return refcounter;
77
- }
78
75
#endif
79
76
static void setTaint (bool val) {
80
77
taint = val;
@@ -83,6 +80,9 @@ namespace Sass {
83
80
virtual const std::string to_string () const = 0;
84
81
85
82
virtual ~SharedObj ();
83
+ long getRefCount () const {
84
+ return refcounter;
85
+ }
86
86
};
87
87
88
88
@@ -115,6 +115,9 @@ namespace Sass {
115
115
SharedObj* operator -> () const {
116
116
return node;
117
117
};
118
+ bool isNull () {
119
+ return node == NULL ;
120
+ };
118
121
bool isNull () const {
119
122
return node == NULL ;
120
123
};
@@ -176,8 +179,6 @@ namespace Sass {
176
179
177
180
~SharedImpl () {};
178
181
public:
179
- using SharedPtr::isNull;
180
- using SharedPtr::operator bool ;
181
182
operator T*() const {
182
183
return static_cast <T*>(this ->obj ());
183
184
}
@@ -196,6 +197,15 @@ namespace Sass {
196
197
T* detach () {
197
198
return static_cast <T*>(SharedPtr::detach ());
198
199
}
200
+ bool isNull () const {
201
+ return this ->obj () == NULL ;
202
+ }
203
+ bool operator <(const T& rhs) const {
204
+ return *this ->ptr () < rhs;
205
+ };
206
+ operator bool () const {
207
+ return this ->obj () != NULL ;
208
+ };
199
209
};
200
210
201
211
}
You can’t perform that action at this time.
0 commit comments