Skip to content

Commit 0c6b552

Browse files
committed
Fix when executing table::free() before process exit, it causes mutex lock not work in other processes. see https://github.com/swoole/benchmark/blob/master/table.php [random_rw test]
1 parent 3d8abe6 commit 0c6b552

File tree

3 files changed

+0
-13
lines changed

3 files changed

+0
-13
lines changed

ext-src/swoole_table.cc

-4
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ static void inline php_swoole_table_set_ptr(zval *zobject, Table *ptr) {
110110
}
111111

112112
static inline void php_swoole_table_free_object(zend_object *object) {
113-
Table *table = php_swoole_table_fetch_object(object)->ptr;
114-
if (table) {
115-
table->free();
116-
}
117113
zend_object_std_dtor(object);
118114
}
119115

include/swoole_table.h

-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ class Table {
198198
TableRow *get(const char *key, uint16_t keylen, TableRow **rowlock);
199199
bool del(const char *key, uint16_t keylen);
200200
void forward();
201-
// only release local memory of the current process
202-
void free();
203201
// release shared memory
204202
void destroy();
205203

src/memory/table.cc

-7
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ Table *Table::make(uint32_t rows_size, float conflict_proportion) {
5555
return table;
5656
}
5757

58-
void Table::free() {
59-
delete mutex;
60-
delete iterator;
61-
delete column_map;
62-
delete column_list;
63-
}
64-
6558
bool Table::add_column(const std::string &_name, enum TableColumn::Type _type, size_t _size) {
6659
if (_type < TableColumn::TYPE_INT || _type > TableColumn::TYPE_STRING) {
6760
swoole_warning("unknown column type");

0 commit comments

Comments
 (0)