Fix event listener leak in code that is generated to take functions. Fix to generate new NPL 1.1 license. r=joki

This commit is contained in:
waterson%netscape.com 1999-11-18 20:38:43 +00:00
Родитель a583abbe39
Коммит 28474b593f
2 изменённых файлов: 22 добавлений и 13 удалений

Просмотреть файл

@ -36,20 +36,25 @@
static const char *kNPLStr = \ static const char *kNPLStr = \
"/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n" "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n"
" *\n"" * The contents of this file are subject to the Netscape Public License\n"
" * Version 1.0 (the \"NPL\"); you may not use this file except in\n"
" * compliance with the NPL. You may obtain a copy of the NPL at\n"
" * http://www.mozilla.org/NPL/\n"
" *\n" " *\n"
" * Software distributed under the NPL is distributed on an \"AS IS\" basis,\n" " * The contents of this file are subject to the Netscape Public\n"
" * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL\n" " * License Version 1.1 (the \"License\"); you may not use this file\n"
" * for the specific language governing rights and limitations under the\n" " * except in compliance with the License. You may obtain a copy of\n"
" * NPL.\n" " * the License at http://www.mozilla.org/NPL/\n"
" *\n" " *\n"
" * The Initial Developer of this code under the NPL is Netscape\n" " * Software distributed under the License is distributed on an \"AS\n"
" * IS\" basis, WITHOUT WARRANTY OF ANY KIND, either express or\n"
" * implied. See the License for the specific language governing\n"
" * rights and limitations under the License.\n"
" *\n"
" * The Original Code is mozilla.org code.\n"
" *\n"
" * The Initial Developer of the Original Code is Netscape\n"
" * Communications Corporation. Portions created by Netscape are\n" " * Communications Corporation. Portions created by Netscape are\n"
" * Copyright (C) 1998 Netscape Communications Corporation. All Rights\n" " * Copyright (C) 1998 Netscape Communications Corporation. All\n"
" * Reserved.\n" " * Rights Reserved.\n"
" *\n"
" * Contributor(s): \n"
" */\n"; " */\n";
static const char *kDisclaimerStr = "/* AUTO-GENERATED. DO NOT EDIT!!! */\n"; static const char *kDisclaimerStr = "/* AUTO-GENERATED. DO NOT EDIT!!! */\n";
static const char *kObjTypeStr = "nsIDOM%s*"; static const char *kObjTypeStr = "nsIDOM%s*";
@ -148,7 +153,7 @@ FileGen::GetVariableTypeForMethodLocal(char *aBuffer, IdlVariable &aVariable)
sprintf(aBuffer, kXPIDLObjTypePtrStr, aVariable.GetTypeName()); sprintf(aBuffer, kXPIDLObjTypePtrStr, aVariable.GetTypeName());
break; break;
case TYPE_FUNC: case TYPE_FUNC:
sprintf(aBuffer, kObjTypeStr, aVariable.GetTypeName()); sprintf(aBuffer, kObjTypePtrStr, aVariable.GetTypeName());
break; break;
case TYPE_JSVAL: case TYPE_JSVAL:
strcpy(aBuffer, "jsval"); strcpy(aBuffer, "jsval");

Просмотреть файл

@ -1078,7 +1078,11 @@ static const char kMethodIntParamStr[] =
sprintf(buffer, kMethodIntParamStr, paramNum, paramNum) sprintf(buffer, kMethodIntParamStr, paramNum, paramNum)
static const char kMethodFuncParamStr[] = static const char kMethodFuncParamStr[] =
" if (!nsJSUtils::nsConvertJSValToFunc(&b%d,\n" #ifdef USE_COMPTR
" if (!nsJSUtils::nsConvertJSValToFunc(getter_AddRefs(b%d),\n"
#else
" if (!nsJSUtils::nsConvertJSValToFunc((nsIDOMEventListener**)(nsISupports**) &b%d,\n"
#endif
" cx,\n" " cx,\n"
" obj,\n" " obj,\n"
" argv[%d])) {\n" " argv[%d])) {\n"