| 152 |
{ |
{ |
| 153 |
snprintf(ex_menu_conf, sizeof(ex_menu_conf), "%s/%d", VAR_GEN_EX_MENU_DIR, p_section->sid); |
snprintf(ex_menu_conf, sizeof(ex_menu_conf), "%s/%d", VAR_GEN_EX_MENU_DIR, p_section->sid); |
| 154 |
|
|
| 155 |
ret = load_menu(&ex_menu_set_new, ex_menu_conf); |
// acquire rw lock of all sections to avoid conflict with menu reload in main process |
| 156 |
|
ret = section_list_rw_lock(NULL); |
| 157 |
if (ret < 0) |
if (ret < 0) |
| 158 |
{ |
{ |
| 159 |
unload_menu(&ex_menu_set_new); |
log_error("section_list_rw_lock(NULL) error\n"); |
|
log_error("load_menu(%s) error: %d\n", ex_menu_conf, ret); |
|
| 160 |
} |
} |
| 161 |
else |
else |
| 162 |
{ |
{ |
| 163 |
if (p_section->ex_menu_tm > 0) |
ret = load_menu(&ex_menu_set_new, ex_menu_conf); |
| 164 |
|
if (ret < 0) |
| 165 |
{ |
{ |
| 166 |
unload_menu(&(p_section->ex_menu_set)); |
unload_menu(&ex_menu_set_new); |
| 167 |
|
log_error("load_menu(%s) error: %d\n", ex_menu_conf, ret); |
| 168 |
} |
} |
| 169 |
|
else |
| 170 |
|
{ |
| 171 |
|
if (p_section->ex_menu_tm > 0) |
| 172 |
|
{ |
| 173 |
|
unload_menu(&(p_section->ex_menu_set)); |
| 174 |
|
} |
| 175 |
|
|
| 176 |
ex_menu_set_new.allow_exit = 1; // Allow exit menu |
ex_menu_set_new.allow_exit = 1; // Allow exit menu |
| 177 |
memcpy(&(p_section->ex_menu_set), &ex_menu_set_new, sizeof(ex_menu_set_new)); |
memcpy(&(p_section->ex_menu_set), &ex_menu_set_new, sizeof(ex_menu_set_new)); |
| 178 |
|
|
| 179 |
p_section->ex_menu_tm = atol(row[7]); |
p_section->ex_menu_tm = atol(row[7]); |
| 180 |
#ifdef _DEBUG |
#ifdef _DEBUG |
| 181 |
log_common("Loaded gen_ex_menu of section %d [%s]\n", p_section->sid, p_section->sname); |
log_common("Loaded gen_ex_menu of section %d [%s]\n", p_section->sid, p_section->sname); |
| 182 |
#endif |
#endif |
| 183 |
|
} |
| 184 |
|
|
| 185 |
|
// release rw lock of all sections |
| 186 |
|
ret = section_list_rw_unlock(NULL); |
| 187 |
|
if (ret < 0) |
| 188 |
|
{ |
| 189 |
|
log_error("section_list_rw_unlock(NULL) error\n"); |
| 190 |
|
} |
| 191 |
} |
} |
| 192 |
} |
} |
| 193 |
|
|
| 813 |
|
|
| 814 |
// gen_ex_menu cleanup |
// gen_ex_menu cleanup |
| 815 |
section_list_ex_menu_set_cleanup(); |
section_list_ex_menu_set_cleanup(); |
| 816 |
|
|
| 817 |
// Detach data pools shm |
// Detach data pools shm |
| 818 |
detach_section_list_shm(); |
detach_section_list_shm(); |
| 819 |
detach_article_block_shm(); |
detach_article_block_shm(); |