[Win32utils-devel] Pointer bug in win32-taskscheduler?

Daniel Berger djberg96 at gmail.com
Sun Jan 13 00:52:58 EST 2008


Hi all,

I thought this was strange:

ts = TaskScheduler.new
ts.new_work_item('foo', trigger)
p ts.status
ts.save
p ts.status # null pointer (ts_get_status)

I noticed that in the ts_save function in taskscheduler.c we're doing 
this at line 278:

ptr->pITask->Release();
ptr->pITask = NULL;

At first I thought this was a mistake but it looks like it's required.

I think part of what's confusing me is that we're not encapsulating work 
items separately and that TaskScheduler#status only checks the currently 
active task. Maybe a separate TaskScheduler::Task class would be a good 
idea, though it would mean more work.

Thoughts?

Regards,

Dan



More information about the win32utils-devel mailing list