From: Liu Y. <yub...@gm...> - 2009-02-05 01:26:56
|
Claes Wikstrom wrote: > Liu Yubao wrote: >> Hi, >> >> Erasing whole process dictionary when get(init_db) returns >> undefined will make the clause below in proc_lib:exit_p/2 >> throw a badmatch exception: >> %% erl5.6.5/lib/stdlib-1.15.5/src/proc_lib.erl:158 >> exit_p(Class, Reason) -> >> {M,F,A} = get('$initial_call'), >> >> The yaws-1.79 has fixed this problem in another way, but I >> think my patch(made against yaws-1.77) is more proper because: >> >> * put(init_db, I) is only called in aloop(); >> * returning undefined from get(init_db) means we haven't enter >> aloop(), so we shouldn't call clear() always. > > > Agree, Thanks, Applied. > Aha, you combined my patch without reverting the original fix... I think it's better to remove the "put(init_db, I)" clause because: * The original fix isn't required any more to make proc_lib:exit_p/2 work; * The current *combined* patch does some useless work; erase_transients(): put(init_db, I), lists:foreach(......), aloop() calls init_db(): put(init_db, lists:keydelete(init_db, 1, get())). The call to put() in erase_transients() is useless. See attachment for a new patch against newest code in svn repository. Best regards, Liu Yubao |