Re-apply several tools fixes lost by the directory rearrangement.
Leaks on error in tools/aapt/Images.cpp. https://code.google.com/p/android/issues/detail?id=61552 Two missing fclose calls in tools/aapt/Resource.cpp. https://code.google.com/p/android/issues/detail?id=61553 Missing fclose in tools/aidl/aidl.cpp. https://code.google.com/p/android/issues/detail?id=61554 Change-Id: I56ce144958296961b77354815efc1a245564594b
This commit is contained in:
committed by
Adam Lesinski
parent
2675f76967
commit
b30296b5fd
@@ -462,8 +462,8 @@ static status_t do_9patch(const char* imageName, image_info* image)
|
||||
|
||||
int maxSizeXDivs = W * sizeof(int32_t);
|
||||
int maxSizeYDivs = H * sizeof(int32_t);
|
||||
int32_t* xDivs = (int32_t*) malloc(maxSizeXDivs);
|
||||
int32_t* yDivs = (int32_t*) malloc(maxSizeYDivs);
|
||||
int32_t* xDivs = image->info9Patch.xDivs = (int32_t*) malloc(maxSizeXDivs);
|
||||
int32_t* yDivs = image->info9Patch.yDivs = (int32_t*) malloc(maxSizeYDivs);
|
||||
uint8_t numXDivs = 0;
|
||||
uint8_t numYDivs = 0;
|
||||
int8_t numColors;
|
||||
@@ -520,6 +520,10 @@ static status_t do_9patch(const char* imageName, image_info* image)
|
||||
goto getout;
|
||||
}
|
||||
|
||||
// Copy patch size data into image...
|
||||
image->info9Patch.numXDivs = numXDivs;
|
||||
image->info9Patch.numYDivs = numYDivs;
|
||||
|
||||
// Find left and right of padding area...
|
||||
if (get_horizontal_ticks(image->rows[H-1], W, transparent, false, &image->info9Patch.paddingLeft,
|
||||
&image->info9Patch.paddingRight, &errorMsg, NULL, false) != NO_ERROR) {
|
||||
@@ -555,12 +559,6 @@ static status_t do_9patch(const char* imageName, image_info* image)
|
||||
image->layoutBoundsRight, image->layoutBoundsBottom));
|
||||
}
|
||||
|
||||
// Copy patch data into image
|
||||
image->info9Patch.numXDivs = numXDivs;
|
||||
image->info9Patch.numYDivs = numYDivs;
|
||||
image->info9Patch.xDivs = xDivs;
|
||||
image->info9Patch.yDivs = yDivs;
|
||||
|
||||
// If padding is not yet specified, take values from size.
|
||||
if (image->info9Patch.paddingLeft < 0) {
|
||||
image->info9Patch.paddingLeft = xDivs[0];
|
||||
|
||||
@@ -2219,10 +2219,10 @@ status_t writeResourceSymbols(Bundle* bundle, const sp<AaptAssets>& assets,
|
||||
|
||||
status_t err = writeSymbolClass(fp, assets, includePrivate, symbols,
|
||||
className, 0, bundle->getNonConstantId());
|
||||
fclose(fp);
|
||||
if (err != NO_ERROR) {
|
||||
return err;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
if (textSymbolsDest != NULL && R == className) {
|
||||
String8 textDest(textSymbolsDest);
|
||||
@@ -2241,10 +2241,10 @@ status_t writeResourceSymbols(Bundle* bundle, const sp<AaptAssets>& assets,
|
||||
|
||||
status_t err = writeTextSymbolClass(fp, assets, includePrivate, symbols,
|
||||
className);
|
||||
fclose(fp);
|
||||
if (err != NO_ERROR) {
|
||||
return err;
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
// If we were asked to generate a dependency file, we'll go ahead and add this R.java
|
||||
|
||||
@@ -847,6 +847,7 @@ parse_preprocessed_file(const string& filename)
|
||||
else {
|
||||
fprintf(stderr, "%s:%d: bad type in line: %s\n",
|
||||
filename.c_str(), lineno, line);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
err = gather_types(filename.c_str(), doc);
|
||||
|
||||
Reference in New Issue
Block a user