webMyCal

February 28, 2006

Bug Fixed

OK, the problem was the following:
in the whie loop, at the end of each event, when a hash is pushed into the array, it is done by reference. At the end of the loop we have n references in the array, where n is the number of the events. The problem is that all n references point to the same place in memory because the hash is not reallocate on every iteration.
To solve the problem a deepcopy function was implemented. Now, insted of pushing a reference of the hash into the array, we send that reference to the function, it is deep copied (by values) into a new hash, and the new address is pushed into the array. At the end we have n different addresses in the array, which was the whole point of the game.

Filed under: webMyCal, Backend — Georgi Todorov @ 12:41 am

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress