lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


If I recall coroutine.resume() not until the dead status is reached. And
of course the coroutine is hold in an local variable. Question: Is this
coroutine clean garbaged when the block where the local coroutine is
defined is leaved?

   do
      local MyProducer=Producer()  -- returns the coroutine
      repeat
         Error,Data=coroutine.resume(MyProducer)
      until not Data
      print(coroutine.status(MyProducer))  --> suspended!
   end
   print(MyProducer)  --> nil

Hopefully this technic is clean.

 --
Markus