/* * Here, we (finally), actually free the memory associated with an object */ int objP_free_mem_impl(ABObj *objPtr) { #define obj (*objPtr) obj_destruct(obj); util_free(obj); obj= NULL; return 0; #undef obj }
static int write_map_window( GenCodeInfo genCodeInfo, ABObj window, BOOL show ) { File codeFile = genCodeInfo->code_file; ABObj project = obj_get_project(window); ABObj proj_root_window = abmfP_get_root_window(project); ABObjRec showActionRec; ABObj showAction = &showActionRec; ABObj winParent = NULL; char winParentName[1024]; obj_construct(showAction, AB_TYPE_ACTION, NULL); *winParentName = 0; obj_set_from(showAction, NULL); obj_set_to(showAction, window); obj_set_func_type(showAction, AB_FUNC_BUILTIN); obj_set_func_builtin(showAction, AB_STDACT_SHOW); winParent = obj_get_win_parent(window); if (winParent == NULL) { sprintf(winParentName, "%s()", abmfP_lib_get_toplevel_widget->name); } else { strcpy(winParentName, abmfP_get_c_name(genCodeInfo, winParent)); } abio_printf(codeFile, "%s(%s, %s);\n", abmfP_get_init_proc_name(window), abmfP_get_c_struct_ptr_name(genCodeInfo, window), winParentName); if (show) abmfP_write_builtin_action(genCodeInfo, showAction, FALSE); obj_destruct(showAction); return 0; }