File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -156,13 +156,15 @@ lwc_string_ref(lwc_string *str)
156156 * freed. (Ref count of 1 where string is its own insensitve match
157157 * will also result in the string being freed.)
158158 */
159- #define lwc_string_unref (str ) { \
160- lwc_string *__lwc_s = (str); \
161- assert(__lwc_s != NULL); \
162- __lwc_s->refcnt--; \
163- if ((__lwc_s->refcnt == 0) || \
164- ((__lwc_s->refcnt == 1) && (__lwc_s->insensitive == __lwc_s))) \
165- lwc_string_destroy(__lwc_s); \
159+ #define lwc_string_unref (str ) { \
160+ lwc_string *__lwc_s = (str); \
161+ if (__lwc_s != NULL) { \
162+ __lwc_s->refcnt--; \
163+ if ((__lwc_s->refcnt == 0) || \
164+ ((__lwc_s->refcnt == 1) && \
165+ (__lwc_s->insensitive == __lwc_s))) \
166+ lwc_string_destroy(__lwc_s); \
167+ } \
166168 }
167169
168170/**
You can’t perform that action at this time.
0 commit comments