[comp.sys.amiga.tech] Intuition and Graphics Libraries

mcw@wet.UUCP (Martin Warnett) (11/27/89)

The sample intuition program in the CA Intuition reference manual, pages
18-20 opens both the graphics and intuition library but doesn't close
them. I realise this libraries are in ROM but....

	a) Is there a reason these libraries should NOT be closed?
	b) Is this just sloppy code?
	c) Does it really matter?

My coding standards say that I should close everything I open, this doesn't
cause any problems. Just wondering.

Thanks,

Martin.
-- 
+====================================================================+
| Martin Warnett          | uucp:   ...sun!claris!wet!mcw            |
| San Francisco, CA       |         claris!wet!mcw@ames.arc.nasa.gov |
+====================================================================+

adam@cbmcats.UUCP (Adam Keith Levin) (11/30/89)

In article <797@wet.UUCP> mcw@wet.UUCP (Martin Warnett) writes:
>The sample intuition program in the CA Intuition reference manual, pages
>18-20 opens both the graphics and intuition library but doesn't close
>them. I realise this libraries are in ROM but....
>
>	a) Is there a reason these libraries should NOT be closed?
>	b) Is this just sloppy code?
>	c) Does it really matter?
>
>My coding standards say that I should close everything I open, this doesn't
>cause any problems. Just wondering.
>
>Thanks,
>
>Martin.
>-- 
>+====================================================================+
>| Martin Warnett          | uucp:   ...sun!claris!wet!mcw            |
>| San Francisco, CA       |         claris!wet!mcw@ames.arc.nasa.gov |
>+====================================================================+

a) No.
b) Yes.
c) Only in that the library can never be flushed from memory if
   the amount of free memory gets low.  This doesn't apply to ROM
   libraries, but it is good practice (as you stated) to return ALL
   resources when you are done with them.

The new Addison-Wesley "Amiga ROM Kernel Reference Manual:Libraries and Devices"
(which includes Exec and Intuition) has much more "correct" examples.
No, I have no information on when it will be available.

-- 
Adam Keith Levin  --  CATS     Commodore Applications and Technical Support
1200 Wilson Drive / West Chester, PA  19380                  (215) 431-9180
BIX: aklevin             UUCP: ...{amiga|rutgers|uunet}!cbmvax!cbmcats!adam