Skip to content

Memory crash on exceptions in timer callback #42

Description

@eco747

module/base/timer/modTimer.c : xs_timer_callback function should take care of exceptions in callback call because in case of exception fxForget is not called but c_free is.

more generally exceptions are not handled in timer callback and that not really good. They should also be traced somewhere.

code should be

        xsBeginHost(ts->the);

		xsTry {
			xsCallFunction1(xsReference(ts->callback), xsGlobal, ts->self);
		}
		xsCatch {
			//xsStringValue message = fxToString(ts->the,&xsException);
			//xsDebugLog( message );
		}

		if (0 == modTimerGetSecondInterval(timer)) {
			xsForget(ts->self);
			ts->callback = NULL;
		}

	xsEndHost(ts->the);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions