Template:Leaking Nasal disclaimer: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
mNo edit summary
(Readability improvement; +links; +-cat)
Line 1: Line 1:
{{caution|Using the <code>{{{oldapi|foo}}}</code> API, it is fairly easy to leak resources by not using the API properly. This happens typically by not keeping track of how many callbacks (or loops) are registered to be invoked/running by a certain timer/listener. Equally, [[Reset & re-init]] handling is often not done properly by such low-level code because listeners and timers need to be manually tracked/managed. These days, it is generally recommended to favor the <code>{{{newapi|bar}}}</code> API instead. Alternatively, you should consider wrapping the low-level APIs using a helper class, which is also the recommended way for supporting multiple different FlightGear binaries.}}
{{caution|'''Improper use''' of the <code>{{{oldapi|foo}}}</code> API may cause '''resource leaks'''.
 
This typically is caused by the low-level nature of such code, requiring manual tracking of [[Using listeners and signals with Nasal|listeners]] and [[Nasal Loops#settimer loops|timers]] and manual [[Reset & re-init|reset and re-init handling]].
 
It is '''instead recommended''' that you use the <code>{{{newapi|bar}}}</code> API. Alternatively a wrapping helper class can be used to handle low-level APIs, which is the recommended way to support multiple FlightGear versions.}}
<noinclude>
<noinclude>
[[Category:Templates]]
[[Category:Messagebox templates]]
[[Category:Undocumented templates]]
[[Category:Undocumented templates]]
</noinclude>
</noinclude>

Revision as of 11:12, 10 January 2015

CautionImproper use of the foo API may cause resource leaks.

This typically is caused by the low-level nature of such code, requiring manual tracking of listeners and timers and manual reset and re-init handling.

It is instead recommended that you use the bar API. Alternatively a wrapping helper class can be used to handle low-level APIs, which is the recommended way to support multiple FlightGear versions.