diff --git a/src/kits/app/AppMisc.cpp b/src/kits/app/AppMisc.cpp index c71d0c8326..bb240efa9f 100644 --- a/src/kits/app/AppMisc.cpp +++ b/src/kits/app/AppMisc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -7,14 +7,14 @@ */ -#include -#include - #include #include #include #include +#include +#include + namespace BPrivate { @@ -117,10 +117,12 @@ get_app_ref(entry_ref *ref, bool traverse) team_id current_team() { - team_id team = -1; - thread_info info; - if (get_thread_info(find_thread(NULL), &info) == B_OK) - team = info.team; + static team_id team = -1; + if (team < 0) { + thread_info info; + if (get_thread_info(find_thread(NULL), &info) == B_OK) + team = info.team; + } return team; }