Wireshark-bugs: [Wireshark-bugs] [Bug 4140] emem patches

Date: Wed, 28 Oct 2009 17:43:01 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4140





--- Comment #16 from Guy Harris <guy@xxxxxxxxxxxx>  2009-10-28 17:42:57 PDT ---
A very good routine for freeing many resources is called exit(). :-)

Whether it's "best practice" to manually free all memory before calling exit()
or returning from main() is a matter of debate.  A certain Cupertino-based
company actually thinks using "kill -9" to shut down applications with no data
to be saved is a good idea:

   
http://developer.apple.com/mac/library/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_6.html

"Improved Shutdown
To improve the user experience in Mac OS X v10.6, API improvements help your
application contribute to shorter shutdown times.

To support improved shutdown, your application needs to mark itself as
“dirty” or “clean,” depending on whether it has unsaved changes and
needs to do work before quitting, or can be terminated without further notice.
When the system shuts down, clean applications are terminated (via SIGKILL)
without further interaction."

so if your application has registered as supporting "sudden termination", and
has indicated that it has nothing it would need to save to stable storage when
it exits, it will be killed with "kill -9" when you log out or shut the machine
down.

For memory that needs to be kept around as long as the application is running,
presumably one should tell memcheck to suppress those errors:

    http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress

(And, yes, I think emem_cleanup() is already doing more work than is really
necessary, if it's to be called  as part of the exit path.  We already have to
pop up a "Closing file!  Please wait ..." dialog when exiting, which is a bug -
applications shouldn't, after you ask them to quit, take so long to exit that
you can see a dialog box saying it's quitting.)


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.