>>TEXT *my_text = txt_create(1, 1);<<
The problem is that this creates a text any time you call that function, and thus will quickly overwhelm your game with lots of TEXTs. I don't know if this is the reason of your problem, but the proper way to create something in a more-than-once called function is:
static TEXT *my_text = NULL;
if(!my_text) my_text = txt_create(...);
Objects that are global to the whole game, such as a TEXT object, should be normally created in the main function and not in a local action.