File: | stoc/source/registry_tdprovider/tdmodule.cxx |
Location: | line 81, column 17 |
Description: | Called C++ object pointer is null |
1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | |||
2 | /* | |||
3 | * This file is part of the LibreOffice project. | |||
4 | * | |||
5 | * This Source Code Form is subject to the terms of the Mozilla Public | |||
6 | * License, v. 2.0. If a copy of the MPL was not distributed with this | |||
7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | |||
8 | * | |||
9 | * This file incorporates work covered by the following license notice: | |||
10 | * | |||
11 | * Licensed to the Apache Software Foundation (ASF) under one or more | |||
12 | * contributor license agreements. See the NOTICE file distributed | |||
13 | * with this work for additional information regarding copyright | |||
14 | * ownership. The ASF licenses this file to you under the Apache | |||
15 | * License, Version 2.0 (the "License"); you may not use this file | |||
16 | * except in compliance with the License. You may obtain a copy of | |||
17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . | |||
18 | */ | |||
19 | ||||
20 | ||||
21 | #include <vector> | |||
22 | #include <osl/diagnose.h> | |||
23 | #include "base.hxx" | |||
24 | ||||
25 | namespace stoc_rdbtdp | |||
26 | { | |||
27 | ||||
28 | //__________________________________________________________________________________________________ | |||
29 | // virtual | |||
30 | ModuleTypeDescriptionImpl::~ModuleTypeDescriptionImpl() | |||
31 | { | |||
32 | delete _pMembers; | |||
33 | ||||
34 | g_moduleCount.modCnt.release( &g_moduleCount.modCnt ); | |||
35 | } | |||
36 | ||||
37 | // XTypeDescription | |||
38 | //__________________________________________________________________________________________________ | |||
39 | // virtual | |||
40 | TypeClass ModuleTypeDescriptionImpl::getTypeClass() | |||
41 | throw( RuntimeException ) | |||
42 | { | |||
43 | return TypeClass_MODULE; | |||
44 | } | |||
45 | //__________________________________________________________________________________________________ | |||
46 | // virtual | |||
47 | OUString ModuleTypeDescriptionImpl::getName() | |||
48 | throw( RuntimeException ) | |||
49 | { | |||
50 | return _aName; | |||
51 | } | |||
52 | ||||
53 | // XModuleTypeDescription | |||
54 | //__________________________________________________________________________________________________ | |||
55 | // virtual | |||
56 | Sequence< Reference< XTypeDescription > > SAL_CALL | |||
57 | ModuleTypeDescriptionImpl::getMembers() | |||
58 | throw ( RuntimeException ) | |||
59 | { | |||
60 | if ( !_pMembers ) | |||
| ||||
61 | { | |||
62 | Reference< XTypeDescriptionEnumeration > xEnum; | |||
63 | try | |||
64 | { | |||
65 | xEnum = _xTDMgr->createTypeDescriptionEnumeration( | |||
66 | _aName, | |||
67 | Sequence< TypeClass >(), | |||
68 | TypeDescriptionSearchDepth_ONE ); | |||
69 | } | |||
70 | catch ( NoSuchTypeNameException const & ) | |||
71 | { | |||
72 | } | |||
73 | catch ( InvalidTypeNameException const & ) | |||
74 | { | |||
75 | } | |||
76 | ||||
77 | OSL_ENSURE( xEnum.is(),do { if (true && (!(xEnum.is()))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/registry_tdprovider/tdmodule.cxx" ":" "78" ": "), "%s", "ModuleTypeDescriptionImpl::getMembers - No enumeration!" ); } } while (false) | |||
78 | "ModuleTypeDescriptionImpl::getMembers - No enumeration!" )do { if (true && (!(xEnum.is()))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/registry_tdprovider/tdmodule.cxx" ":" "78" ": "), "%s", "ModuleTypeDescriptionImpl::getMembers - No enumeration!" ); } } while (false); | |||
79 | ||||
80 | std::vector< Reference< XTypeDescription > > aTDs; | |||
81 | while ( xEnum->hasMoreElements() ) | |||
| ||||
82 | { | |||
83 | try | |||
84 | { | |||
85 | Reference< XTypeDescription > xTD( | |||
86 | xEnum->nextTypeDescription() ); | |||
87 | aTDs.push_back( xTD ); | |||
88 | } | |||
89 | catch ( NoSuchElementException const & ) | |||
90 | { | |||
91 | OSL_FAIL( "ModuleTypeDescriptionImpl::getMembers - "do { if (true && (((sal_Bool)1))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/registry_tdprovider/tdmodule.cxx" ":" "92" ": "), "%s", "ModuleTypeDescriptionImpl::getMembers - " " Caught NoSuchElementException!"); } } while (false) | |||
92 | " Caught NoSuchElementException!" )do { if (true && (((sal_Bool)1))) { sal_detail_logFormat ((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/usr/local/src/libreoffice/stoc/source/registry_tdprovider/tdmodule.cxx" ":" "92" ": "), "%s", "ModuleTypeDescriptionImpl::getMembers - " " Caught NoSuchElementException!"); } } while (false); | |||
93 | } | |||
94 | } | |||
95 | ||||
96 | Sequence< Reference< XTypeDescription > > * pMembers | |||
97 | = new Sequence< Reference< XTypeDescription > >( aTDs.size() ); | |||
98 | for ( sal_Int32 n = 0; n < pMembers->getLength(); n++ ) | |||
99 | (*pMembers)[ n ] = aTDs[ n ]; | |||
100 | ||||
101 | ClearableMutexGuard aGuard( getMutex() ); | |||
102 | if ( _pMembers ) | |||
103 | { | |||
104 | aGuard.clear(); | |||
105 | delete pMembers; | |||
106 | } | |||
107 | else | |||
108 | { | |||
109 | _pMembers = pMembers; | |||
110 | } | |||
111 | } | |||
112 | return *_pMembers; | |||
113 | } | |||
114 | ||||
115 | } | |||
116 | ||||
117 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |