On Mon, Oct 15, 2001, Robert Steinhäußer wrote:
> My program segfaults sometimes.
You mean Hamlib :-)
> It seems like some drivers cannot handle it when a Rig::close() is called
> without a preceding Rig::open().
Oops, good point!
> How about a public method bool isOpen()? The setXxx/getXxx methods could
> throw an exception if !isOpen(). close() should just be tolerant and do
> nothing.
>
> BTW: Does ~Rig() automatically call close()? I believe it should.
okay, this has to be fixed in Hamlib, not Hamlib++.
I've added a comm_state field to rig_state, and I protected rig_open(),
rig_close() and rig_cleanup() using it. Also, if rig_cleanup() is called
while the rig is still open, it will also close it as you suggested.
Now, every single Hamlib function has to be protected. Next time!
Cheers,
Stephane - F8CFE
|