[haiku-bugs] [Haiku] #14520: Bug in BApplication API doc?

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Mon, 24 Sep 2018 16:49:41 -0000

#14520: Bug in BApplication API doc?
-------------------------------+------------------------------
 Reporter:  ahwayakchih        |        Owner:  nielx
     Type:  bug                |       Status:  new
 Priority:  normal             |    Milestone:  Unscheduled
Component:  Documentation      |      Version:  R1/Development
 Keywords:  API, BApplication  |   Blocked By:
 Blocking:                     |  Has a Patch:  0
 Platform:  All                |
-------------------------------+------------------------------
 In example code of BApplication API (https://www.haiku-
 os.org/docs/api/classBApplication.html#details), there is something there
 that does not look right:
 {{{
     BApplication app("application/x-vnd.vendor-application");
     app->Run();
     delete app;
 }}}

 I guess it's ok to create it on stack, but:
 - 2nd line tries to access function as if {{{app}}} was a pointer,
 - 3rd line tries to delete it, as if it was created on Heap (using {{{new
 BApplication()}}}) instead of Stack

-- 
Ticket URL: <https://dev.haiku-os.org/ticket/14520>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: