Skip to content

Commit 511dd86

Browse files
committed
2 parents ee30255 + b4d1bd1 commit 511dd86

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

inc/hgl/Macro.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,6 @@ namespace hgl
7777
name=nullptr; \
7878
} \
7979
}
80-
}//namespace hgl
80+
81+
#define SAFE_CLEAR_STD_MAP(name) {for(auto &it:name)delete it.second;}
82+
}//namespace hgl

inc/hgl/type/StringInstance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ namespace hgl
400400

401401
if(need_length>malloc_length)
402402
{
403-
malloc_length=power_to_2(need_length);
403+
malloc_length=power_to_2(need_length+1);
404404

405405
T *new_str=new T[malloc_length];
406406

0 commit comments

Comments
 (0)