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

Heesob Park phasis at gmail.com
Sun Jan 13 01:12:50 EST 2008


2008/1/13, Daniel Berger <djberg96 at gmail.com>:
> 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.

The active task can be chchecked with ptr->pITask.

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?

There are two categoris in TaskScheduler. Create a Task and Modify a Task.
I think seperating two job is more reasonable.

It might be helpful to refer Perl's approach.

> Dan
> _______________________________________________
> win32utils-devel mailing list
> win32utils-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/win32utils-devel


Park Heesob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20080113/9efd687e/attachment.html 

More information about the win32utils-devel mailing list